appcelerator
Advanced tools
Comparing version 4.2.14 to 4.2.15-1
@@ -15,7 +15,5 @@ // jscs:disable jsDoc | ||
path = require('path'), | ||
urllib = require('url'), | ||
download = require('./download'), | ||
util = require('./util'), | ||
errorlib = require('./error'), | ||
zlib = require('zlib'), | ||
tar = require('tar'), | ||
@@ -479,4 +477,7 @@ chalk = require('chalk'), | ||
// if this is a use or setup, we don't run, we just return | ||
if (opts.use) { return cb && cb(null, installDir, version, installBin); } | ||
// if this is a use we don't run, we just return | ||
if (opts.use) { | ||
util.killDaemon(version, installBin); | ||
return cb && cb(null, installDir, version, installBin); | ||
} | ||
@@ -483,0 +484,0 @@ debug('running %s', installBin); |
@@ -13,6 +13,3 @@ // jscs:disable jsDoc | ||
debug = require('debug')('appc:use'), | ||
chalk = require('chalk'), | ||
exec = require('child_process').exec, | ||
fs = require('fs'), | ||
path = require('path'); | ||
chalk = require('chalk'); | ||
@@ -32,13 +29,6 @@ function use(opts, callback, wantVersion) { | ||
debug('making %s your active version, dir %s', version, installBin); | ||
var pkgFile = path.join(util.getInstallDir(), version, 'package', 'package.json'); | ||
var pkg = fs.existsSync(pkgFile) && require(pkgFile); | ||
if (pkg && 'appcd' in pkg.dependencies) { | ||
debug('stop appcd'); | ||
return exec(installBin + ' appcd stop', function (err, stdout, stderr) { | ||
switchCoreAndOut(version); | ||
}); | ||
} | ||
switchCoreAndOut(version); | ||
util.writeVersion(version); | ||
util.killDaemon(version, installBin); | ||
console.log(chalk.yellow(version) + ' is now your active version'); | ||
process.exit(0); | ||
} | ||
@@ -107,8 +97,2 @@ opts.use = true; | ||
function switchCoreAndOut(version) { | ||
util.writeVersion(version); | ||
console.log(chalk.yellow(version) + ' is now your active version'); | ||
process.exit(0); | ||
} | ||
function handleOffline(err, opts, getLatest) { | ||
@@ -115,0 +99,0 @@ // looks like we are offline |
@@ -21,3 +21,4 @@ // jscs:disable jsDoc | ||
cachedConfig, | ||
sprite = '/-\\|'; | ||
sprite = '/-\\|', | ||
execSync = require('child_process').execSync; | ||
@@ -1065,2 +1066,20 @@ var MAX_RETRIES = exports.MAX_RETRIES = 5; | ||
function killDaemon(version, installBin) { | ||
var pkgFile = path.join(getInstallDir(), version, 'package', 'package.json'); | ||
var pkg = fs.existsSync(pkgFile) && require(pkgFile); | ||
if (isWindows()) { | ||
installBin = '"' + process.execPath + '" "' + installBin + '"'; | ||
} | ||
if (pkg && 'appcd' in pkg.dependencies) { | ||
debug('stop appcd'); | ||
try { | ||
execSync(installBin + ' appcd stop'); | ||
} catch (error) { | ||
// ignore | ||
debug('error killing the daemon'); | ||
debug(error); | ||
} | ||
} | ||
} | ||
exports.getAppcDir = getAppcDir; | ||
@@ -1110,1 +1129,2 @@ exports.getHomeDir = getHomeDir; | ||
exports.outputInfo = outputInfo; | ||
exports.killDaemon = killDaemon; |
{ | ||
"name": "appcelerator", | ||
"version": "4.2.14", | ||
"version": "4.2.15-1", | ||
"description": "Appcelerator Platform Software installer", | ||
@@ -56,3 +56,6 @@ "main": "index.js", | ||
"node": ">=8.0.0" | ||
}, | ||
"publishConfig": { | ||
"tag": "next" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
457135
2648
44
2