Skip to content

Commit

Permalink
Show warning console if version.js file is missing (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
sujono91 authored and yangshun committed May 21, 2018
1 parent 67c84c1 commit 436a3d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 436a3d0

Please sign in to comment.