Skip to content

Commit

Permalink
fix: correctly handle --max-arg-length cli option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia_Khrebtov authored and iiroj committed May 24, 2022
1 parent f0536dc commit 1db5f26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/lint-staged.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cmdline
.option('-c, --config [path]', 'path to configuration file, or - to read from stdin')
.option('--cwd [path]', 'run all tasks in specific directory, instead of the current')
.option('-d, --debug', 'print additional debug information', false)
.option('--max-arg-length', 'maximum length of the command-line argument string')
.option('--max-arg-length [number]', 'maximum length of the command-line argument string', 0)
.option('--no-stash', 'disable the backup stash, and do not revert in case of errors', false)
.option('-q, --quiet', 'disable lint-staged’s own console output', false)
.option('-r, --relative', 'pass relative filepaths to tasks', false)
Expand All @@ -61,7 +61,7 @@ const options = {
configPath: cmdlineOptions.config,
cwd: cmdlineOptions.cwd,
debug: !!cmdlineOptions.debug,
maxArgLength: JSON.parse(cmdlineOptions.maxArgLength || null),
maxArgLength: cmdlineOptions.maxArgLength || undefined,
quiet: !!cmdlineOptions.quiet,
relative: !!cmdlineOptions.relative,
shell: cmdlineOptions.shell /* Either a boolean or a string pointing to the shell */,
Expand Down

0 comments on commit 1db5f26

Please sign in to comment.