Some tooling cleanup

This commit is contained in:
Brahim Hadriche committed 2023-07-05 21:00:10 -04:00
1 parent 80bcd4c870
commit 70d66f874d
17 files changed
+145 -46

No files matched your search

+13 -4
View File
@@ -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;
}