getNonIgnoredFiles
Lists the repository files that .gitignore does not exclude.
Covers both tracked files and untracked-but-not-ignored ones, so a brand-new file is checked before it is ever committed.
Import:
import { getNonIgnoredFiles } from 'obsidian-dev-utils/script-utils/git';Signature:
function getNonIgnoredFiles(options: GetNonIgnoredFilesOptions | undefined): Promise<string[] | null>Parameters:
| Parameter | Type | Description |
|---|---|---|
options | GetNonIgnoredFilesOptions | undefined | The GetNonIgnoredFilesOptions. |
Returns: Promise<string[] | null> — A Promise that resolves with the matching paths, relative to the root folder and separated by /; or with null when git cannot answer — it is not installed, or the project is not a git repository (a tarball checkout, for instance). Callers fall back to their own listing in that case.
Links to this page: