Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AppCreator.prototype.run = function run(callback) {
Creator.prototype.run.apply(this, arguments);
const argv = this.cli.argv,
platforms = ti.scrubPlatforms(argv.platforms),
projectDir = appc.fs.resolvePath(argv['workspace-dir'], argv.name);
fs.ensureDirSync(projectDir);
// download/install the project template
this.processTemplate(function (err, templateDir) {
if (err) {
return callback(err);
}
let projectConfig = null;
const tasks = [
function (next) {
// copy the template files, if exists
const dir = path.join(templateDir, 'template');
if (!fs.existsSync(dir)) {
ModuleCreator.prototype.run = function run(callback) {
Creator.prototype.run.apply(this, arguments);
const platforms = ti.scrubPlatforms(this.cli.argv.platforms),
projectName = this.cli.argv.name,
projectDir = this.projectDir = appc.fs.resolvePath(this.cli.argv['workspace-dir'], projectName),
id = this.cli.argv.id;
fs.ensureDirSync(projectDir);
// download/install the project template
this.processTemplate(function (err, templateDir) {
if (err) {
return callback(err);
}
const variables = {
author: this.config.get('user.name', 'Your Name'),
publisher: this.config.get('app.publisher', 'Your Company'),
guid: uuid.v4(),
return function (finished) {
logger.log.init(function () {
const result = ti.validatePlatformOptions(logger, config, cli, 'cleanModule');
if (result && typeof result === 'function') {
result(finished);
} else {
finished(result);
}
});
};
} else {
let platforms = cli.argv.platforms || cli.argv.platform;
if (platforms) {
platforms = ti.scrubPlatforms(platforms);
if (platforms.bad.length) {
logger.error(__n('Invalid platform: %%s', 'Invalid platforms: %%s', platforms.bad.length, platforms.bad.join(', ')) + '\n');
logger.log(__('Available platforms for SDK version %s:', ti.manifest.sdkVersion) + '\n');
ti.targetPlatforms.forEach(function (p) {
logger.log(' ' + p.cyan);
});
logger.log();
process.exit(1);
}
cli.argv.platforms = platforms.scrubbed;
} else {
cli.argv.platforms = null;
}