appcelerator
Advanced tools
Comparing version 4.2.10-1 to 4.2.10-2
@@ -53,2 +53,4 @@ /** | ||
mochaOptions: ['--bail'], | ||
reporter: 'mocha-jenkins-reporter', | ||
reportFormats: ['lcov', 'cobertura'], | ||
check: { | ||
@@ -55,0 +57,0 @@ statements: 50, |
@@ -438,4 +438,4 @@ // jscs:disable jsDoc | ||
// write current Node version to package dir | ||
util.writeNodeVersion(installDir); | ||
// write current process versions to package dir | ||
util.writeVersions(installDir); | ||
@@ -442,0 +442,0 @@ // if this is a use or setup, we don't run, we just return |
@@ -50,4 +50,4 @@ /** | ||
debug('run check package node version'); | ||
if (installBin && util.isNodeVersionChanged(installBin)) { | ||
debug('run check package modules version'); | ||
if (installBin && util.isModuleVersionChanged(installBin)) { | ||
util.outputInfo(chalk.yellow('\nYou are attempting to run appc ' + | ||
@@ -70,3 +70,3 @@ util.getActiveVersion() + | ||
// update node version | ||
util.writeNodeVersion(path.join(packageDir, '..')); | ||
util.writeVersions(path.join(packageDir, '..')); | ||
util.outputInfo(chalk.yellow('Package modules rebuilt!\n'), isJSON); | ||
@@ -94,3 +94,3 @@ } else { | ||
['SIGTERM', 'SIGUSR1', 'SIGUSR2', 'SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGABRT', 'exit'].forEach(function (name) { | ||
process.on(name, function () { | ||
process.on(name, function (code) { | ||
// Windows does not support sending signals | ||
@@ -100,6 +100,6 @@ if (!isWin) { | ||
// process to remain alive, mainly because the child wasn't able to leave on time | ||
debug('signal received', name, 'sending to', child); | ||
debug('signal received', name, 'code:', code, ', sending to', child); | ||
if (name === 'exit') { | ||
child.kill(); | ||
process.exit(arguments[0]); | ||
process.exit(Array.isArray(code) ? code[code.length - 1] : code); | ||
} else { | ||
@@ -114,3 +114,3 @@ child.kill(name); | ||
if (cb) { cb(results); } | ||
if (!dontexit) { process.exit(results); } | ||
if (!dontexit) { process.exit(Array.isArray(results) ? results[results.length - 1] : results); } | ||
}); | ||
@@ -117,0 +117,0 @@ } |
@@ -79,3 +79,3 @@ // jscs:disable jsDoc | ||
// Is this JSON output ? | ||
if ('json' === util.parseOpts(opts).o) { | ||
if ('json' === opts.output) { | ||
obj = util.getVersionJson(opts, result); | ||
@@ -82,0 +82,0 @@ console.log(JSON.stringify(obj, null, '\t')); |
@@ -954,13 +954,37 @@ // jscs:disable jsDoc | ||
/** | ||
* write out the Node version used to install package | ||
* write out the process.versions info stored when installing package | ||
*/ | ||
function writeNodeVersion(pkgDir) { | ||
var versionFile = path.join(pkgDir, '.nodeversion'), | ||
nodeVersion = process.version; | ||
function writeVersions(pkgDir) { | ||
var versionsFile = path.join(pkgDir, '.nodeversions'), | ||
versions = process.versions, | ||
versionsStr = JSON.stringify(versions); | ||
debug('writing node version: %s to %s', nodeVersion, versionFile); | ||
debug('writing node version: %s to %s', versionsStr, versionsFile); | ||
if (fs.existsSync(versionsFile)) { | ||
fs.unlinkSync(versionsFile); | ||
} | ||
fs.writeFileSync(versionsFile, versionsStr); | ||
// remove old file | ||
var oldVersionFile = path.join(pkgDir, '.nodeversion'); | ||
if (fs.existsSync(oldVersionFile)) { | ||
fs.unlinkSync(oldVersionFile); | ||
} | ||
} | ||
/** | ||
* return the process.versions info when install the package | ||
*/ | ||
function readVersions(installBin) { | ||
var versionFile = path.join(installBin, '..', '..', '..', '.nodeversions'), | ||
versions; | ||
if (fs.existsSync(versionFile)) { | ||
fs.unlinkSync(versionFile); | ||
try { | ||
versions = JSON.parse(fs.readFileSync(versionFile)); | ||
} catch (e) { | ||
debug('unable to read versions file.'); | ||
} | ||
return versions; | ||
} | ||
fs.writeFileSync(versionFile, nodeVersion); | ||
} | ||
@@ -986,7 +1010,32 @@ | ||
/** | ||
* check if the modules version changed since the package was installed | ||
*/ | ||
function isModuleVersionChanged(installBin) { | ||
var versions = readVersions(installBin), | ||
usedVersion = versions && versions.modules, | ||
currentModuleVersion = process.versions && process.versions.modules, | ||
result = false; | ||
if (usedVersion && currentModuleVersion) { | ||
result = (usedVersion !== currentModuleVersion); | ||
debug('modules version used %s, current version %s, result: %s', usedVersion, currentModuleVersion, result); | ||
} else { | ||
result = isNodeVersionChanged(installBin); | ||
} | ||
return result; | ||
} | ||
/** | ||
* return the NodeJS version used to install the package | ||
*/ | ||
function getPackageNodeVersion(installBin) { | ||
var versions = readVersions(installBin), | ||
usedNodeVersion = versions && versions.node; | ||
if (usedNodeVersion) { | ||
return usedNodeVersion; | ||
} | ||
var versionFile = path.join(installBin, '..', '..', '..', '.nodeversion'); | ||
if (fs.existsSync(versionFile)) { | ||
@@ -1045,5 +1094,5 @@ return fs.readFileSync(versionFile).toString().trim(); | ||
exports.readConfig = readConfig; | ||
exports.writeNodeVersion = writeNodeVersion; | ||
exports.isNodeVersionChanged = isNodeVersionChanged; | ||
exports.writeVersions = writeVersions; | ||
exports.isModuleVersionChanged = isModuleVersionChanged; | ||
exports.getPackageNodeVersion = getPackageNodeVersion; | ||
exports.outputInfo = outputInfo; |
{ | ||
"name": "appcelerator", | ||
"version": "4.2.10-1", | ||
"version": "4.2.10-2", | ||
"description": "Appcelerator Platform Software installer", | ||
@@ -14,3 +14,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "grunt" | ||
"test": "JUNIT_REPORT_PATH=junit_report.xml grunt" | ||
}, | ||
@@ -31,11 +31,12 @@ "repository": { | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt": "^1.0.1", | ||
"grunt-appc-js": "^1.0.19", | ||
"grunt-contrib-clean": "^0.7.0", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-env": "0.4.4", | ||
"grunt-mocha-istanbul": "^3.0.1", | ||
"grunt-mocha-istanbul": "^5.0.2", | ||
"istanbul": "^0.4.1", | ||
"lodash": "^3.10.1", | ||
"should": "^8.0.2", | ||
"mocha": "^2.3.4" | ||
"mocha": "^2.3.4", | ||
"mocha-jenkins-reporter": "^0.3.7" | ||
}, | ||
@@ -48,5 +49,5 @@ "dependencies": { | ||
"request": "^2.55.0", | ||
"semver": "~3.0.1", | ||
"tar": "1.0.3", | ||
"which": "1.0.8", | ||
"semver": "~3.0.1" | ||
"which": "1.0.8" | ||
}, | ||
@@ -53,0 +54,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
Found 1 instance in 1 package
447608
30
0
10
2579