Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
log("Git local copy up to date.");
}
}
const pkg = path.join(process.cwd(), "package.json");
log("package.json is '" + pkg + "'.");
const version = require(pkg).version;
notice("Preparing v" + version + ".");
log("Checking existing tags.");
const gitTags = exec("git tag", { silent: true });
if (gitTags.code !== 0) {
error("Can't read tags.");
exit(1);
} else if (gitTags.output.split("\n").indexOf(version) > -1) {
error("Tag already exist.");
exit(1);
}
let cleanupPromise;
if (argv["skip-cleanup"]) {
log("Cleanup skipped.");
cleanupPromise = Promise.resolve();
} else {
log("Cleaning node_modules.");
const nodeModules = path.join(process.cwd(), "node_modules");
if (argv.verbose) {
debug("Will delete '" + nodeModules + "'.");
}
cleanupPromise = trash([nodeModules]).then(() => {
log("node_modules deleted.");
export async function ping (ctx) {
ctx.body = {
version: pkg.version
}
}