Comparing version 0.1.4 to 0.1.5
@@ -9,2 +9,5 @@ CHANGELOG | ||
## 0.1.5 (2014-01-27) | ||
* Release prompt now has the current package version as the default | ||
## 0.1.4 (2014-01-27) | ||
@@ -11,0 +14,0 @@ * Added line and version args to grunt cli commands |
@@ -41,3 +41,3 @@ 'use strict'; | ||
// These plugins provide necessary tasks. | ||
grunt.loadTasks('./tasks') | ||
grunt.loadTasks('./tasks'); | ||
grunt.loadNpmTasks('grunt-contrib-nodeunit'); | ||
@@ -44,0 +44,0 @@ grunt.loadNpmTasks('grunt-contrib-jshint'); |
@@ -12,2 +12,3 @@ /* | ||
var prompt = require('prompt'); | ||
var fs = require('fs'); | ||
@@ -24,3 +25,3 @@ var commands = module.exports = {}; | ||
} else { | ||
textPrompt('Add one line to the changelog', function(err, text){ | ||
textPrompt('Add one line to the changelog', {}, function(err, text){ | ||
if (err) { return callback(err); } | ||
@@ -33,6 +34,13 @@ chg.add(text, {}, callback); | ||
commands.release = function(version, options, callback){ | ||
options = options || {}; | ||
if (version) { | ||
chg.release(version, options, callback); | ||
} else { | ||
textPrompt('What is the release version number?', function(err, text){ | ||
// use current package.json version as the default prompt value | ||
if (fs.existsSync('./package.json')) { | ||
options.default = require(process.cwd() + '/package.json').version; | ||
} | ||
textPrompt('What is the release version number?', options, function(err, text){ | ||
if (err) { return callback(err); } | ||
@@ -58,9 +66,14 @@ chg.release(text, options, callback); | ||
function textPrompt(message, callback){ | ||
function textPrompt(message, options, callback){ | ||
if (!options) { | ||
callback = options; | ||
options = {}; | ||
} | ||
options.name = 'text'; | ||
options.message = message; | ||
options.required = true; | ||
prompt.start(); | ||
prompt.get({ | ||
name: 'text', | ||
message: message, | ||
required: true | ||
}, function (err, result) { | ||
prompt.get(options, function (err, result) { | ||
if (err) { | ||
@@ -67,0 +80,0 @@ return callback(err); |
{ | ||
"name": "chg", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"main": "lib/changelog.js", | ||
@@ -5,0 +5,0 @@ "description": "simple changelog/release history manager", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
15802
305
4