Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
// Check if config file exists, if not warn the user.
if (config) {
try {
fs.accessSync(configFile, fs.F_OK);
} catch (e) {
console.log('Warning: build file not found, using defaults...');
}
}
// switch to cordova directory
process.chdir('./cordova');
// build with options and distribute to Fabric if specified
return cordova.raw.build(buildOpts).then(
function() {
if (distribute) {
fabric.distribute(platforms, target);
}
},
function(error) {
console.log('Build failed:', error);
}
);
};
var msg = cmd[0];
cmd.slice(1).forEach(function(arg) {
if (Array.isArray(arg)) {
msg += ' ' + arg.join(' ');
return;
} else if (typeof arg != 'string') {
return;
}
if (arg.indexOf(' ') != -1) {
msg += ' "' + arg + '"';
} else {
msg += ' ' + arg;
}
});
console.log('## Running Cordova Command: ' + msg);
return cordova.raw[cmd[0]].apply(cordova, cmd.slice(1))
.fail(function(err) {
if (err.name == 'CordovaError') {
return Q.reject(err.message);
} else {
return Q.reject(err.stack);
}
});
};
.then(function() {
return cordova.raw.platforms('add', 'ios');
})
.then(function() {
}, function(err, result) {
if(err){
return cb(err);
}
cordova.raw.build({
platforms: ['android'],
options: {
release: true,
argv: [
"--keystore", "../android-sign/upload.keystore",
"--alias", "upload",
"--storePassword", result.password,
"--password", result.password
]
}
}).done(cb);
});
});
.then(function() {
return cordova.raw.build({
'platforms': ['ios'],
'options': [
'--release',
'--gradleArg=--no-daemon',
'--buildConfig=' + config + '.json'
]
});
})
.then(function() {