@emeryld/obs-stack 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/obs-stack.js +13 -3
- package/package.json +1 -1
package/bin/obs-stack.js
CHANGED
|
@@ -6,9 +6,19 @@ const dotenv = require('dotenv');
|
|
|
6
6
|
const startObsStackMenu = require('./obs-stack-menu');
|
|
7
7
|
|
|
8
8
|
const ROOT = path.resolve(__dirname, '..');
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const ROOT_ENV_PATH = path.join(ROOT, '.env');
|
|
10
|
+
|
|
11
|
+
function loadEnvFile(envPath, options = {}) {
|
|
12
|
+
if (fs.existsSync(envPath)) {
|
|
13
|
+
dotenv.config({ path: envPath, ...options });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
loadEnvFile(ROOT_ENV_PATH);
|
|
18
|
+
|
|
19
|
+
const PROJECT_ENV_PATH = path.join(process.cwd(), '.env');
|
|
20
|
+
if (PROJECT_ENV_PATH !== ROOT_ENV_PATH) {
|
|
21
|
+
loadEnvFile(PROJECT_ENV_PATH, { override: true });
|
|
12
22
|
}
|
|
13
23
|
|
|
14
24
|
const COMPOSE_FILE = path.join(ROOT, 'docker-compose.yml');
|