isIgnored
Test whether a filepath should be ignored (because of .gitignore or .git/exclude)
| param | type [= default] | description |
|---|---|---|
| fs | FsClient | a file system client |
| dir | string | The working tree directory path |
| gitdir | string = join(dir, '.git') | The git directory path |
| filepath | string | The filepath to test |
| return | Promise<boolean> | Resolves to true if the file should be ignored |
Example Code:
await git.isIgnored({ fs, dir: '/tutorial', filepath: 'docs/add.md' })
Tip: If you need a clean slate, expand and run this snippet to clean up the file system.
window.fs = new LightningFS('fs', { wipe: true })
window.pfs = window.fs.promises
console.log('done')