Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// EXEC INTERFACE
export const exec = (command, settings) => {
return new Promise((resolve, reject) => {
_exec(command, settings, (error, stdout) => {
if (error) {
reject(error);
} else {
resolve(stdout);
}
});
});
};
// CUSTOM ERROR
export const SmoothReleaseError = errorEx('SmoothReleaseError');
export const onError = e => {
status.stop();
if (e instanceof SmoothReleaseError) {
error(`\nError: ${e.message}\n`);
} else {
error('\n', e.stack);
}
process.exit(1);
};
// UTILS
export const getCurrentBranch = () => execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
export const isVersionTag = tag => (