From 436a3d04d213360b71fc6edc45983b192def0f0b Mon Sep 17 00:00:00 2001 From: Sujono Date: Mon, 21 May 2018 14:37:05 +0700 Subject: [PATCH] Show warning console if version.js file is missing (#678) --- lib/version.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/version.js b/lib/version.js index 0eefc9834502..875db756bb50 100755 --- a/lib/version.js +++ b/lib/version.js @@ -33,6 +33,16 @@ program }) .parse(process.argv); +const hasVersionFile = fs.existsSync(CWD + '/pages/en/versions.js'); +if (!hasVersionFile) { + console.error( + `${chalk.yellow( + 'No versions.js file found!' + )}\nYou should create your versions.js file in pages/en directory.\nPlease refer to https://docusaurus.io/docs/en/versioning.html.` + ); + process.exit(1); +} + if (typeof version === 'undefined') { console.error( `${chalk.yellow(