Some tooling cleanup
This commit is contained in:
1 parent
80bcd4c870
commit
70d66f874d
17 files changed
+145
-46
No files matched your search
+13
-4
@@ -1,14 +1,23 @@
|
||||
const dotenv = require('dotenv');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const envFile = path.join(__dirname, '../.env');
|
||||
|
||||
function getEnvVars() {
|
||||
let envVars = process.env;
|
||||
if (fs.existsSync('.vscode/.env')) {
|
||||
const envConfig = dotenv.parse(fs.readFileSync('.vscode/.env'));
|
||||
if (fs.existsSync(envFile)) {
|
||||
const envConfig = dotenv.parse(fs.readFileSync(envFile));
|
||||
envVars = { ...envVars, ...envConfig };
|
||||
}
|
||||
|
||||
|
||||
return envVars;
|
||||
}
|
||||
|
||||
module.exports = getEnvVars;
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = getEnvVars;
|
||||
}
|
||||
|
||||
if (typeof exports !== 'undefined') {
|
||||
exports.getEnvVars = getEnvVars;
|
||||
}
|
||||
Reference in new issue
Block a user