mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-18 20:47:51 +00:00
Update prod env only when variables are defined
This commit is contained in:
parent
0eeb983951
commit
6734776153
@ -8,10 +8,14 @@ if(argv.set) {
|
|||||||
const envFile = argv.set;
|
const envFile = argv.set;
|
||||||
console.log(`Backuping up '${envFile}' into '${tempFile}'.`);
|
console.log(`Backuping up '${envFile}' into '${tempFile}'.`);
|
||||||
fs.copyFileSync(envFile, tempFile);
|
fs.copyFileSync(envFile, tempFile);
|
||||||
const content = fs.readFileSync(envFile, "utf8");
|
let content = fs.readFileSync(envFile, "utf8");
|
||||||
const variables = `solarputty_download_url: '${process.env.SOLARPUTTY_DOWNLOAD_URL}',`
|
|
||||||
const replaced = content.replace('//ENV', variables);
|
if(process.env.SOLARPUTTY_DOWNLOAD_URL) {
|
||||||
fs.writeFileSync(envFile, replaced);
|
const variables = `solarputty_download_url: '${process.env.SOLARPUTTY_DOWNLOAD_URL}',`
|
||||||
|
content = content.replace('solarputty_download_url: "",', variables);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(envFile, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argv.unset) {
|
if(argv.unset) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
/* Below configuration is replaced during build time, don't remove. */
|
|
||||||
//ENV
|
|
||||||
production: true,
|
production: true,
|
||||||
electron: false,
|
electron: false,
|
||||||
githubio: false,
|
githubio: false,
|
||||||
|
solarputty_download_url: "",
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user