Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.error(__('%s is not a valid entry name', key) + '\n');
}
process.exit(1);
}
break;
case 2:
key = args[0];
switch (key) {
case 'deployment-targets':
// Get list of platforms from ti manifest and set to false (default value)
result = {};
// add ipad and blackberry to list of platforms
[ 'ipad', 'blackberry' ].concat(ti.availablePlatforms).forEach(function (p) {
result[p] = false;
});
// Validate the platforms and override the tiapp.xml setting to true
value = args[1].split(',');
value.forEach(function (p) {
if (!Object.prototype.hasOwnProperty.call(result, p)) {
logger.error(__('Unsupported deployment target "%s"', p) + '\n');
logger.log(__('Available deployment targets are:'));
Object.keys(result).sort().forEach(function (p) {
logger.log(' ' + p.cyan);
});
logger.log();
process.exit(1);
}
});
validator: function (platform) {
if (!platform) {
throw new Error(__('Invalid platform'));
} else if (ti.availablePlatforms.indexOf(platform) === -1) {
throw new Error(__('Invalid platform: %s', platform));
}
return true;
}
},