diff --git a/scripts/create-version.js b/scripts/create-version.js index 76cacec45..af3736ab4 100644 --- a/scripts/create-version.js +++ b/scripts/create-version.js @@ -6,7 +6,10 @@ const setVersion = () => { version: versionToDeploy, }; const jsonData = JSON.stringify(object); - fs.writeFile("catalog/version/version.json", jsonData, (err) => { + const versionDirectory = "./catalog/version/"; + if (!fs.existsSync(versionDirectory)) + fs.mkdirSync(versionDirectory, { recursive: true }); + fs.writeFile(`${versionDirectory}version.json`, jsonData, (err) => { if (err) throw err; }); };