node-titanium-sdk
Advanced tools
Comparing version 0.4.8 to 0.4.9
@@ -541,10 +541,35 @@ /** | ||
if (err) return callback(err); | ||
if (devices.filter(function (d) { return d.id == deviceId }).length != 1) return callback(new Error(__('device not found'))); | ||
// Fetch info about the device we're installing to. | ||
devices = devices.filter(function (d) { return d.id === deviceId }); | ||
if (devices.length < 1) return callback(new Error(__('device not found'))); | ||
const deviceInfo = devices[0]; | ||
androidDetect(this.config, function (err, results) { | ||
if (err) return callback(err); | ||
opts.logger && opts.logger.trace(__('Executing: %s', [results.sdk.executables.adb, '-s', deviceId, 'install', '-r', '-d', apkFile].join(' ').cyan)); | ||
// Fetch the device's API Level. | ||
let deviceApiLevel = 1; | ||
if (deviceInfo.sdk) { | ||
const value = parseInt(deviceInfo.sdk); | ||
if (!isNaN(value)) { | ||
deviceApiLevel = value; | ||
} | ||
} | ||
appc.subprocess.run(results.sdk.executables.adb, ['-s', deviceId, 'install', '-r', '-d', apkFile], function (code, out, err) { | ||
// Set up the 'adb' arguments array. | ||
const args = []; | ||
args.push('-s', deviceId); | ||
args.push('install'); | ||
args.push('-r'); | ||
if (deviceApiLevel >= 17) { | ||
// Allow installation of an older APK version over a newer one. | ||
// Note: Only supported on Android 4.2 (API Level 17) and higher. | ||
args.push('-d'); | ||
} | ||
args.push(apkFile); | ||
// Run the adb install command. | ||
opts.logger && opts.logger.trace(__('Executing: %s', [results.sdk.executables.adb].concat(args).join(' ').cyan)); | ||
appc.subprocess.run(results.sdk.executables.adb, args, function (code, out, err) { | ||
var m = out.match(/^Failure \[(.+)\]$/m); | ||
@@ -551,0 +576,0 @@ if ((code && err.indexOf('No space left on device') != -1) || (!code && m && m[1] == 'INSTALL_FAILED_INSUFFICIENT_STORAGE')) { |
@@ -79,3 +79,3 @@ /** | ||
tiNodeRegExp = /^Ti(tanium)?/; | ||
if (value == null) return null; | ||
if (value == null) { return null; } | ||
if (tiNodeRegExp.test(value)) { | ||
@@ -127,3 +127,3 @@ // if value.startsWith('Ti.'), replace with 'Titanium.' | ||
errmsg.push(''); | ||
errmsg.push(' ' + contents[ex.line-1].replace(/\t/g, ' ')); | ||
errmsg.push(' ' + contents[ex.line - 1].replace(/\t/g, ' ')); | ||
if (ex.col) { | ||
@@ -147,3 +147,3 @@ var i = 0, | ||
MemberExpression: { | ||
enter: function(path) { | ||
enter: function (path) { | ||
var memberExpr = getTitaniumExpression(path.node); | ||
@@ -176,2 +176,3 @@ if (memberExpr) { | ||
if (opts.transpile) { | ||
options.plugins.push(require.resolve('./global-this')); | ||
options.presets.push([ env, { targets: opts.targets } ]); | ||
@@ -253,3 +254,3 @@ } | ||
try { | ||
var dom = new DOMParser({ errorHandler: function(){} }).parseFromString('<temp>\n' + contents + '\n</temp>', 'text/html'), | ||
var dom = new DOMParser({ errorHandler: function () {} }).parseFromString('<temp>\n' + contents + '\n</temp>', 'text/html'), | ||
doc = dom && dom.documentElement, | ||
@@ -256,0 +257,0 @@ scripts = doc && doc.getElementsByTagName('script'), |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"author": { | ||
@@ -57,4 +57,4 @@ "name": "Appcelerator, Inc.", | ||
"scripts": { | ||
"test": "JUNIT_REPORT_PATH=junit_report.xml mocha --require tests/init --reporter mocha-jenkins-reporter --check-leaks tests/test-tiappxml.js" | ||
"test": "JUNIT_REPORT_PATH=junit_report.xml mocha --require tests/init --reporter mocha-jenkins-reporter --check-leaks tests/*_test.js" | ||
} | ||
} |
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
220518
30
5558
71
1
1
1
2
38