Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-git-tag-version flag #250

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ const cli = meow(`
${version.SEMVER_INCREMENTS.join(' | ')} | 1.2.3

Options
--any-branch Allow publishing from any branch
--no-cleanup Skips cleanup of node_modules
--yolo Skips cleanup and testing
--no-publish Skips publishing
--tag Publish under a given dist-tag
--no-yarn Don't use Yarn
--any-branch Allow publishing from any branch
--no-cleanup Skips cleanup of node_modules
--yolo Skips cleanup and testing
--no-publish Skips publishing
--no-git-tag-version Skips commit of a version tag
--tag Publish under a given dist-tag
--no-yarn Don't use Yarn

Examples
$ np
Expand All @@ -47,6 +48,10 @@ const cli = meow(`
tag: {
type: 'string'
},
gitTagVersion: {
type: 'boolean',
default: true
},
yarn: {
type: 'boolean',
default: hasYarn()
Expand Down
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ module.exports = (input, opts) => {
{
title: 'Bumping version using npm',
enabled: () => opts.yarn === false,
task: () => exec('npm', ['version', input])
task: () => {
const args = ['version', input];

if (!opts.gitTagVersion) {
args.push('--no-git-tag-version');
}

return exec('npm', args);
}
}
]);

Expand All @@ -122,6 +130,10 @@ module.exports = (input, opts) => {
args.push('--tag', opts.tag);
}

if (!opts.gitTagVersion) {
args.push('--no-git-tag-version');
}

return exec('yarn', args);
}
},
Expand Down