diff --git a/.gitignore b/.gitignore index e2b8d7af5..525e216f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/**/* +config-local.json desktop-build/ dist/ release/ diff --git a/get-config.js b/get-config.js index 76151684c..51e03caa5 100644 --- a/get-config.js +++ b/get-config.js @@ -1,3 +1,15 @@ +function readLocalConfig() { + try { + const config = require('./config-local'); + if (typeof config === 'function') { + throw new Error('Invalid config file. Config must be JSON.'); + } + return config; + } catch { + return false; + } +} + function readConfig() { try { const config = require('./config'); @@ -17,7 +29,7 @@ function readConfig() { } function getConfig() { - var config = readConfig(); + var config = readLocalConfig() || readConfig(); var pkg = require('./package.json'); config.version = pkg.version; return config;