version-bump-prompt
Advanced tools
Comparing version 0.2.5 to 1.0.1
20
bump.js
@@ -12,4 +12,6 @@ #!/usr/bin/env node | ||
.usage('[options]') | ||
.option('--no-tags', 'Do not create git tag') | ||
.option('--push', 'Push to remote repo') | ||
.option('--commit', 'Commit changed files to Git') | ||
.option('--tag', 'Commit and tag changed files in Git') | ||
.option('--push', 'Commit and push changed files to remote Git repo') | ||
.option('--all', 'Commit/tag/push all files that have changed, not just the ones changed by bump') | ||
.option('--prompt', 'Prompt for type of bump (patch, minor, major)'); | ||
@@ -26,3 +28,3 @@ | ||
tagAndPush(); | ||
doGit(); | ||
}, 0); | ||
@@ -62,3 +64,3 @@ }); | ||
else { | ||
tagAndPush(); | ||
doGit(); | ||
} | ||
@@ -75,4 +77,4 @@ } | ||
$ bump --patch | ||
$ bump --major --no-tags | ||
$ bump --prompt --push | ||
$ bump --major --tag | ||
$ bump --prompt --tag --push --all | ||
@@ -89,7 +91,7 @@ */ | ||
function tagAndPush() { | ||
if (program.tags) { | ||
api.tag(program.push); | ||
function doGit() { | ||
if (program.commit || program.tag || program.push) { | ||
api.commit(program.all, program.tag, program.push); | ||
} | ||
} | ||
18
index.js
@@ -11,3 +11,3 @@ 'use strict'; | ||
function logError(err) { | ||
console.log(err); | ||
console.error(err); | ||
} | ||
@@ -47,7 +47,9 @@ | ||
exports.tag = function(push) { | ||
exec('git commit ' + exports.manifests().join(' ') + ' -m "release v' + version + '"') | ||
.then(function() { | ||
// console.log(out.stdout); | ||
return exec('git tag v' + version); | ||
exports.commit = function(all, tag, push) { | ||
var filesToCommit = all ? '-a' : exports.manifests().join(' '); | ||
exec('git commit ' + filesToCommit + ' -m "release v' + version + '"') | ||
.then(function(out) { | ||
// out && console.log(out.stdout); | ||
return tag && exec('git tag v' + version); | ||
}, logError) | ||
@@ -61,6 +63,4 @@ | ||
.then(function(out) { | ||
if (out) { | ||
console.log(out.stdout); | ||
} | ||
out && console.log(out.stdout); | ||
}, logError); | ||
}; |
{ | ||
"name": "version-bump-prompt", | ||
"version": "0.2.5", | ||
"version": "1.0.1", | ||
"description": "Automatically (or with prompts) bump your version number, GIT tag, and GIT push", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# Version-Bump-Prompt | ||
[![Dependencies](https://img.shields.io/david/bigstickcarpet/version-bump-prompt.svg)](https://david-dm.org/bigstickcarpet/version-bump-prompt) | ||
[![npm](http://img.shields.io/npm/v/swagger-parser.svg)](https://www.npmjs.com/package/version-bump-prompt) | ||
[![License](https://img.shields.io/npm/l/swagger-parser.svg)](http://en.wikipedia.org/wiki/MIT_License) | ||
[![npm](http://img.shields.io/npm/v/version-bump-prompt.svg)](https://www.npmjs.com/package/version-bump-prompt) | ||
[![License](https://img.shields.io/npm/l/version-bump-prompt.svg)](http://en.wikipedia.org/wiki/MIT_License) | ||
![Build Status](https://github.com/BigstickCarpet/version-bump-prompt/blob/master/screenshot.gif) | ||
#### Automate your release process with a single command | ||
#### Automate your release process with a single command that: | ||
@@ -27,10 +27,12 @@ * Bumps the version number of: | ||
* `--patch`, `--minor`, `--major`, `--prompt` - Increase version number (or prompt) | ||
* `--no-tags` - Do not create git tag | ||
* `--push` - Push to remote repo | ||
* `--patch`, `--minor`, `--major`, `--prompt` - Increase corresponding version number (or prompt) | ||
* `--commit` - Commit changed files to Git | ||
* `--tag` - Commit and tag changed files in Git | ||
* `--push` - Commit and push changed files to remote Git repo | ||
* `--all` - Commit/tag/push all files that have changed, not just the ones changed by bump | ||
## TODO | ||
* `--files` get list of manifests for update | ||
* `--info` shows latest tag and manifests version | ||
* `--files` Get list of manifests for update | ||
* `--info` Shows latest tag and manifests version | ||
@@ -37,0 +39,0 @@ ## License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19255
123
0
42
2688