mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-18 06:48:09 +00:00
Update prod env only when variables are defined
This commit is contained in:
@ -8,10 +8,14 @@ if(argv.set) {
|
||||
const envFile = argv.set;
|
||||
console.log(`Backuping up '${envFile}' into '${tempFile}'.`);
|
||||
fs.copyFileSync(envFile, tempFile);
|
||||
const content = fs.readFileSync(envFile, "utf8");
|
||||
const variables = `solarputty_download_url: '${process.env.SOLARPUTTY_DOWNLOAD_URL}',`
|
||||
const replaced = content.replace('//ENV', variables);
|
||||
fs.writeFileSync(envFile, replaced);
|
||||
let content = fs.readFileSync(envFile, "utf8");
|
||||
|
||||
if(process.env.SOLARPUTTY_DOWNLOAD_URL) {
|
||||
const variables = `solarputty_download_url: '${process.env.SOLARPUTTY_DOWNLOAD_URL}',`
|
||||
content = content.replace('solarputty_download_url: "",', variables);
|
||||
}
|
||||
|
||||
fs.writeFileSync(envFile, content);
|
||||
}
|
||||
|
||||
if(argv.unset) {
|
||||
|
Reference in New Issue
Block a user