mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 00:47:03 +02:00
Show warning console if version.js file is missing (#678)
This commit is contained in:
parent
67c84c185c
commit
436a3d04d2
1 changed files with 10 additions and 0 deletions
|
@ -33,6 +33,16 @@ program
|
||||||
})
|
})
|
||||||
.parse(process.argv);
|
.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') {
|
if (typeof version === 'undefined') {
|
||||||
console.error(
|
console.error(
|
||||||
`${chalk.yellow(
|
`${chalk.yellow(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue