diff --git a/packages/docs/references/README.md b/packages/docs/references/README.md index f2bdd18..2bccd72 100644 --- a/packages/docs/references/README.md +++ b/packages/docs/references/README.md @@ -51,6 +51,10 @@ Starting git reference used to evaluate hooks to run. If set, `to` has to be set Ending git reference used to evaluate hooks to run. If set, `from` has to be set as well, otherwise this option is ignored. +- `--config-root` (optional) + +The path of the folder where the mookme configuration file (`.mookme.json`) is stored + ## `mookme inspect` Manually test wich packages are discovered and assess if your hooks are properly configured. diff --git a/packages/mookme/src/commands/run.ts b/packages/mookme/src/commands/run.ts index 5f8b6b1..3e17806 100644 --- a/packages/mookme/src/commands/run.ts +++ b/packages/mookme/src/commands/run.ts @@ -27,12 +27,13 @@ export function addRun(program: commander.Command): void { .option('--from ', 'Starting git reference used to evaluate hooks to run', '') .option('--to ', 'Ending git reference used to evaluate hooks to run', '') .option('--args ', 'The arguments being passed to the hooks', '') + .option('--config-root ', 'The path of the folder where the mookme configuration file is stored', '') .action(async (opts: RunOptions) => { debug('Running run command with options', opts); const git = new GitToolkit(); // Load the different config files - const config = new Config(git.rootDir); + const config = new Config(opts.configRoot || git.rootDir); // Initialize the UI const ui = new MookmeUI(false, config.noClearRenderer ? new NoClearRenderer() : new FancyRenderer()); diff --git a/packages/mookme/src/runner/run.ts b/packages/mookme/src/runner/run.ts index 4b06dd4..e0bafe2 100644 --- a/packages/mookme/src/runner/run.ts +++ b/packages/mookme/src/runner/run.ts @@ -31,6 +31,10 @@ export interface RunOptions { * A boolean parameter to detect if the whole hook suite should be ran, regardless of the VCS state */ to: string; + /** + * The path of the folder where the mookme configuration file is stored + */ + configRoot: string; } /**