Update messages for versioning

This commit is contained in:
Frank Li 2017-08-09 16:17:39 -07:00
parent cdea25eceb
commit 88359ea845
3 changed files with 16 additions and 7 deletions

View file

@ -13,6 +13,7 @@ const glob = require("glob");
const fs = require("fs-extra");
const path = require("path");
const mkdirp = require("mkdirp");
const chalk = require("chalk");
const readMetadata = require("./server/readMetadata.js");
const versionFallback = require("./server/versionFallback.js");
@ -36,14 +37,14 @@ program
if (typeof version === "undefined") {
console.error(
"No version number specified!\nPass the version you wish to create as an argument.\nEx: 1.0.0"
`${chalk.yellow("No version number specified!")}\nPass the version you wish to create as an argument.\nEx: 1.0.0`
);
process.exit(1);
}
if (versions.includes(version)) {
console.error(
"This verison already exists!\nSpecify a new version to create that does not already exist."
`${chalk.yellow("This version already exists!")}\nSpecify a new version to create that does not already exist.`
);
process.exit(1);
}
@ -120,3 +121,5 @@ if (versionFallback.diffLatestSidebar()) {
// update versions.json file
versions.unshift(version);
fs.writeFileSync(CWD + "/versions.json", JSON.stringify(versions, null, 2));
console.log(`${chalk.green("Version " + version + " created!\n")}`);