Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Make CORDOVA_BBTOOLS optional if PATH has tools
  • Loading branch information
jsoref authored and stevengill committed Aug 3, 2015
1 parent f4c1a89 commit 2e3b585c16fad564490f086cec7895d241ce4e65
Showing 7 changed files with 11 additions and 11 deletions.
@@ -21,7 +21,7 @@ var bbtools = process.env.CORDOVA_BBTOOLS,
reg = /host_\d+_\d+/g,
results;

if (reg.test(bbtools)) {
if (bbtools && reg.test(bbtools)) {
results = bbtools.match(reg);
console.log(results[0].split('host_')[1].replace('_', '.'));
} else {
@@ -114,7 +114,7 @@ function generateDeployTokenOptions(targetIp, targetPassword) {
}

function execNativeScript(script, options, callback) {
var fullPath = path.join(process.env.CORDOVA_BBTOOLS, script);
var fullPath = path.join(process.env.CORDOVA_BBTOOLS || "", script);

utils.exec(fullPath, options, {
"cwd" : workingDir,
@@ -21,20 +21,20 @@ module.exports = {
},
info: function (msg) {
if (level === 'verbose') {
console.log("[INFO] " + msg.replace(/info: /i, ""));
console.log("[INFO] " + (""+msg).replace(/info: /i, ""));
}
},
error: function (msg) {
console.error("[ERROR] " + msg.replace(/error: /i, ""));
console.error("[ERROR] " + (""+msg).replace(/error: /i, ""));
},
warn: function (msg) {
if (level !== 'error') {
console.log("[WARN] " + msg.replace(/warning: /i, ""));
console.log("[WARN] " + (""+msg).replace(/warning: /i, ""));
}
},
log: function (msg) {
if (level === "verbose") {
console.log("[INFO] " + msg.replace(/info: /i, ""));
console.log("[INFO] " + (""+msg).replace(/info: /i, ""));
}
}
};
@@ -262,7 +262,7 @@ function generateOptionsFile(session, target, config) {
}

function execNativePackager(session, callback) {
var script = path.join(process.env.CORDOVA_BBTOOLS, "blackberry-nativepackager"),
var script = path.join(process.env.CORDOVA_BBTOOLS || "", "blackberry-nativepackager"),
cwd = session.sourceDir,
nativePkgr;

@@ -237,7 +237,7 @@ _self = {

//Function returns (error || null)
install : function (options, deployTarget, allDone) {
var script = path.join(process.env.CORDOVA_BBTOOLS, "blackberry-deploy"),
var script = path.join(process.env.CORDOVA_BBTOOLS || "", "blackberry-deploy"),
args = [
"-device",
deployTarget.ip
@@ -26,7 +26,7 @@ var path = require('path'),
_self;

function execSigner(session, target, callback) {
var script = path.join(process.env.CORDOVA_BBTOOLS, "blackberry-signer"),
var script = path.join(process.env.CORDOVA_BBTOOLS || "", "blackberry-signer"),
signer,
params = session.getParams("blackberry-signer"),
args = [];
@@ -84,7 +84,7 @@ _self = {
},

getDeviceInfo: function (ip, password, callback) {
var cmd = path.join(process.env.CORDOVA_BBTOOLS, 'blackberry-deploy'),
var cmd = path.join(process.env.CORDOVA_BBTOOLS || '', 'blackberry-deploy'),
args = [
'-listDeviceInfo',
ip
@@ -245,7 +245,7 @@ _self = {
},

checkConnection: function (ip, type, callback) {
var script = path.join(process.env.CORDOVA_BBTOOLS, 'blackberry-deploy'),
var script = path.join(process.env.CORDOVA_BBTOOLS || '', 'blackberry-deploy'),
args = [
'-test',
ip

0 comments on commit 2e3b585

Please sign in to comment.