@@ -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}); |
+1
-1
| { | ||
| "name": "jake", | ||
| "version": "0.2.12", | ||
| "version": "0.2.15", | ||
| "author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)", | ||
@@ -5,0 +5,0 @@ "bin": { |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
87834
1.53%1934
2.11%