build-changelog
Advanced tools
Comparing version 2.0.0 to 2.1.0
var path = require('path'); | ||
var template = require('string-template'); | ||
var version = require('../package.json').version; | ||
var transactJsonFile = require('../lib/transact-json-file.js'); | ||
var majorCommand = '{cmd} --major'; | ||
var minorCommand = '{cmd} --minor'; | ||
var patchCommand = '{cmd} --patch'; | ||
var deprecatedCommand = 'echo DEPRECATED: please run either ' + | ||
'of the changelog-patch or changelog-minor scripts; exit 1'; | ||
function installModule(opts, cb) { | ||
var file = path.join(opts.folder, 'package.json'); | ||
opts.cmd = opts.cmd || 'build-changelog'; | ||
opts.packageVersion = opts.packageVersion || '^' + version; | ||
transactJsonFile(file, function (package) { | ||
package.scripts = package.scripts || {}; | ||
if (!package.scripts.changelog) { | ||
package.scripts.changelog = 'build-changelog'; | ||
package.scripts['changelog-major'] = | ||
template(majorCommand, opts); | ||
package.scripts['changelog-minor'] = | ||
template(minorCommand, opts); | ||
package.scripts['changelog-patch'] = | ||
template(patchCommand, opts); | ||
if (package.scripts.changelog) { | ||
package.scripts.changelog = deprecatedCommand; | ||
} | ||
package.devDependencies = package.devDependencies || {}; | ||
if (!opts.onlyScripts) { | ||
package.devDependencies = package.devDependencies || {}; | ||
package.devDependencies[opts.cmd] = opts.packageVersion; | ||
} | ||
package.devDependencies['build-changelog'] = | ||
'git+ssh://git@github.com/uber/build-changelog.git'; | ||
return package; | ||
@@ -21,0 +39,0 @@ }, cb); |
@@ -11,3 +11,3 @@ var extend = require('xtend'); | ||
patch: true, | ||
logFlags: '--decorate --oneline', | ||
logFlags: '--decorate --first-parent --oneline', | ||
filename: 'CHANGELOG' | ||
@@ -14,0 +14,0 @@ }; |
{ | ||
"name": "build-changelog", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "A CLI to auto-generate a deploy ready changelog", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -20,3 +20,4 @@ var fs = require('fs'); | ||
); | ||
var commitCmd = format('git commit -m \'%s\'', nextVersion); | ||
var commitCmd = format('git commit --no-verify -m \'%s\'', | ||
nextVersion); | ||
var tagCmd = format('git tag v%s -am \'%s\'', nextVersion, | ||
@@ -23,0 +24,0 @@ nextVersion); |
41007
728