-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): CLI argument handling and defaults
BREAKING CHANGE: No `--baseDir` and `--outDir` default values anymore. Asks for explicit values. BREAKING CHANGE: Now stops if `--baseDir` and `--outDir` resolve to same directory to prevent overriding sources. Can be ignored with `--force` flag. BREAKING CHANGE: CLI options now take precedence over config file options. CLI opts used together with config file opts caused config file opts to become effective.
- Loading branch information
1 parent
b57231b
commit c55cee0
Showing
3 changed files
with
89 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const NO_BASEDIR = | ||
`✗ Missing argument --baseDir. | ||
Please provide via command line or config file. | ||
See --help for details. | ||
`; | ||
|
||
const NO_OUTDIR = | ||
`✗ Missing argument --outDir. | ||
Please provide via command line or config file. | ||
See --help for details. | ||
`; | ||
|
||
const OUTDIR_IS_BASEDIR = | ||
`⚠ Warning: --baseDir and --outDir resolve to the same directory. | ||
Such a config is going to overwrite input files in --baseDir. | ||
Choose a different --outDir or change config provided via --config. | ||
Use --force if you want to proceed with current settings. | ||
See --help for details. | ||
` | ||
module.exports = { | ||
NO_BASEDIR, | ||
NO_OUTDIR, | ||
OUTDIR_IS_BASEDIR | ||
} |