mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
Fix version.js script for when there are no versions yet
This commit is contained in:
parent
de2897f108
commit
fd01449db2
1 changed files with 6 additions and 1 deletions
|
@ -17,7 +17,12 @@ const readMetadata = require("./server/readMetadata.js");
|
|||
const versionFallback = require("./server/versionFallback.js");
|
||||
|
||||
const CWD = process.cwd();
|
||||
const versions = require(CWD + "/versions.json");
|
||||
let versions;
|
||||
if (fs.existsSync(CWD + "/versions.json")) {
|
||||
versions = require(CWD + "/versions.json");
|
||||
} else {
|
||||
versions = [];
|
||||
}
|
||||
|
||||
let version;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue