Remove config file for client, moved to .env
This commit is contained in:
@@ -6,12 +6,12 @@ const replace = require('replace-in-file');
|
||||
|
||||
class Options {
|
||||
constructor(key, updatedValue) {
|
||||
this.files = "./config/clientConfig.js";
|
||||
this.files = "./.env";
|
||||
// A regex of the line containing the key in the config file
|
||||
this.from = new RegExp(`"${key}": (.+),`, "g");
|
||||
this.from = new RegExp(`${key}="(.+)",`, "g");
|
||||
// Check to see if the value is a string and needs to be wrapped in double quotes
|
||||
if (typeof updatedValue === "string") this.to = `"${key}": "${updatedValue}",`;
|
||||
else this.to = `"${key}": ${updatedValue},`;
|
||||
if (Array(["string", "number"]).includes(typeof updatedValue)) this.to = `${key}="${updatedValue}",`;
|
||||
else this.to = `${key}=${updatedValue},`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user