Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
} catch (err) {
logger.statusError('Error installing NPM Dev Dependencies');
if (err) logger.error(err.stderr);
errorExit();
return;
}
logger.statusDone('Installing NPM Dev Dependencies');
if (packageJson.postInstall && packageJson.postInstall.length) {
logger.statusStart('Executing NPM Scripts');
try {
if (!isRunningInCwd) {
await exec.promise(`cd ${cwd.replace(/ /g, '\\ ')} && npm run postinstall`, true);
} else {
await exec.promise('npm run postinstall', true);
}
} catch (err) {
logger.statusError('Error executing NPM Scripts');
if (err) logger.error(err.stderr);
errorExit();
return;
}
logger.statusDone('Executing NPM Scripts');
}
// Create Cordova project
if (type.indexOf('cordova') >= 0) {
logger.statusStart(`${'Creating Cordova project'} ${waitText}`);
try {
await createCordova(options);
} catch (err) {
async function commit(sentence) {
let out;
debug(`performing ${chalk.cyan(sentence)}`);
try {
out = await execShPromise(sentence, true);
} catch (e) {
debug('Error: ', e);
debug('Stderr: ', e.stderr);
debug('Stdout: ', e.stdout);
return (
e.stdout.indexOf('nothing to commit') !== -1 ||
e.stderr.indexOf('nothing to commit') !== -1
);
}
return out.stdout.indexOf('nothing to commit') !== -1;
}
],
},
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}
name: 'YES',
value: true,
},
{
name: 'NO',
value: false,
},
],
},
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}
value: true,
},
{
name: 'NO',
value: false,
},
],
},
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}
{
name: 'YES',
value: true,
},
{
name: 'NO',
value: false,
},
],
},
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}
{
name: 'NO',
value: false,
},
],
},
]);
pkg.version = options.version;
fs.writeFileSync(path.resolve(__dirname, '../package.json'), JSON.stringify(pkg, null, 2));
await exec.promise('git pull');
await exec.promise('npm i');
await exec.promise('git add .');
await exec.promise(`git commit -m "${pkg.version} release"`);
await exec.promise('git push');
await exec.promise(`git tag v${pkg.version}`);
await exec.promise('git push origin --tags');
if (options.beta) {
await exec.promise('npm publish --tag beta');
} else {
await exec.promise('npm publish');
}
}