mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 21:47:01 +02:00
Update messages for versioning
This commit is contained in:
parent
cdea25eceb
commit
88359ea845
3 changed files with 16 additions and 7 deletions
|
@ -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")}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue