Show warning console if version.js file is missing (#678)

This commit is contained in:
Sujono 2018-05-21 14:37:05 +07:00 committed by Yangshun Tay
parent 67c84c185c
commit 436a3d04d2

View file

@ -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(