Socket
Socket
Sign inDemoInstall

jake

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jake - npm Package Compare versions

Comparing version 0.2.12 to 0.2.15

62

lib/npm_publish_task.js

@@ -32,6 +32,9 @@ /*

var getPackage = function () {
var pkg = JSON.parse(fs.readFileSync(process.cwd() + '/package.json').toString());
return pkg;
};
var getPackageVersionNumber = function () {
var pkg = JSON.parse(fs.readFileSync(process.cwd() + '/package.json').toString())
, version = pkg.version;
return version;
return getPackage().version;
};

@@ -44,11 +47,52 @@

task('version', function () {
var cmds
, path = process.cwd() + '/package.json'
, pkg = getPackage()
, version = pkg.version
, arr = version.split('.')
, patch
, message;
// Increment the patch-number for the version
patch = parseInt(arr.pop(), 10) + 1
arr.push(patch);
version = arr.join('.');
pkg.version = version;
message = 'Version ' + version
// Update package.json with the new version-info
fs.writeFileSync(path, JSON.stringify(pkg, true, 2));
// Add the version-bump commit
cmds = [
'npm version patch --message "Bumped version number."'
, 'git push origin master'
, 'git push --tags'
'git commit package.json -m "' + message + '"'
];
jake.exec(cmds, function () {
var version = getPackageVersionNumber();
console.log('Bumped version number to v' + version + '.');
complete();
// Only push and tag if the Git repo is clean
exec('git status --porcelain --untracked-files=no',
function (err, stdout, stderr) {
var cmds;
if (err) {
throw err;
return;
}
if (stderr) {
throw new Error(stderr);
return;
}
if (stdout.length) {
throw new Error('Git repository is not clean.');
return;
}
cmds = [
'git push origin master'
, 'git tag -a v' + version + ' -m "' + message + '"'
, 'git push --tags'
];
jake.exec(cmds, function () {
var version = getPackageVersionNumber();
console.log('Bumped version number to v' + version + '.');
complete();
});
});
});

@@ -55,0 +99,0 @@ }, {async: true});

2

package.json
{
"name": "jake",
"version": "0.2.12",
"version": "0.2.15",
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",

@@ -5,0 +5,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc