@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.
Files changed (2) hide show
  1. package/bin/obs-stack.js +13 -3
  2. 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 ENV_PATH = path.join(ROOT, '.env');
10
- if (fs.existsSync(ENV_PATH)) {
11
- dotenv.config({ path: ENV_PATH });
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');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/obs-stack",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Docker Compose-based Grafana + Tempo + Loki + OpenTelemetry Collector stack",
5
5
  "type": "commonjs",
6
6
  "bin": {