mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-27 16:06:59 +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);
|
||||
|
||||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue