forked from JS-DevTools/version-bump-prompt
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { valid as isValidVersion } from 'semver' | ||
import cac from 'cac' | ||
import c from 'picocolors' | ||
import { isReleaseType } from '../release-type' | ||
import type { VersionBumpOptions } from '../types/version-bump-options' | ||
import { version } from '../../package.json' | ||
|
@@ -31,6 +32,7 @@ export function parseArgs(): ParsedArgs { | |
.option('-t, --tag [tag]', 'Tag name', { default: true }) | ||
.option('-p, --push', 'Push to remote', { default: true }) | ||
.option('-y, --yes', 'Skip confirmation') | ||
.option('-r, --recursive', 'Bump package.json files recursively', { default: false }) | ||
.option('--no-verify', 'Skip git verification') | ||
.option('--ignore-scripts', 'Ignore scripts', { default: false }) | ||
.option('-q, --quiet', 'Quiet mode') | ||
|
@@ -56,6 +58,7 @@ export function parseArgs(): ParsedArgs { | |
files: [...args['--'] || [], ...result.args], | ||
ignoreScripts: args.ignoreScripts, | ||
execute: args.execute, | ||
recursive: !!args.recursive, | ||
}, | ||
} | ||
|
||
|
@@ -69,6 +72,14 @@ export function parseArgs(): ParsedArgs { | |
} | ||
} | ||
|
||
if (parsedArgs.options.recursive) { | ||
if (parsedArgs.options.files?.length) | ||
console.log(c.yellow('The --recursive option is ignored when files are specified')) | ||
|
||
else | ||
parsedArgs.options.files = ['package.json', 'package-lock.json', 'packages/**/package.json'] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
antfu
Author
Member
|
||
} | ||
|
||
return parsedArgs | ||
} | ||
catch (error) { | ||
|
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
@antfu What about reading the workspace config? Not all repo is using
packages/**