diff --git a/.changeset/slow-spies-sleep.md b/.changeset/slow-spies-sleep.md new file mode 100644 index 0000000..63fd56b --- /dev/null +++ b/.changeset/slow-spies-sleep.md @@ -0,0 +1,5 @@ +--- +'clean-modules': patch +--- + +Respect `directory` option in `analyze` command. diff --git a/src/cli/commands/analyze.command.ts b/src/cli/commands/analyze.command.ts index d620dac..e795a1e 100644 --- a/src/cli/commands/analyze.command.ts +++ b/src/cli/commands/analyze.command.ts @@ -10,6 +10,7 @@ export class AnalyzeCommand extends BaseCommand { async execute(): Promise { const analyzeResults = await analyze({ + directory: this.directory, globs: this.globs, noDefaults: this.noDefaults, globFile: this.globFile, diff --git a/src/shared.ts b/src/shared.ts index 3f111a8..d42fd9f 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -8,13 +8,13 @@ export const DEFAULT_GLOBS_FILE_PATH = path.resolve( ); export interface SharedOptions { - // The directory to clean, usually node_modules. + /** The directory to clean, usually node_modules. */ directory?: string; - // Path to a custom glob file. Uses `.cleanmodules` by default. + /** Path to a custom glob file. Uses `.cleanmodules` by default. */ globFile?: string; - // Whether or not to include clean-modules' default globs. + /** Whether or not to include clean-modules' default globs. */ noDefaults?: boolean; - // List of custom globs to include or exclude. + /** List of custom globs to include or exclude. */ globs?: string[] | undefined; }