@nmakarov/cli-toolkit 0.46.0 → 0.47.0

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/dist/index.js CHANGED
@@ -1388,36 +1388,29 @@ var Args = class _Args {
1388
1388
  }
1389
1389
  return;
1390
1390
  }
1391
- let dotEnvPathFile = null;
1392
- const envSpecificFile = `.env.${this.env}`;
1393
- const envSpecificPath = resolve(dotEnvPath, envSpecificFile);
1394
- if (existsSync(envSpecificPath)) {
1395
- dotEnvPathFile = envSpecificPath;
1396
- }
1397
- if (!dotEnvPathFile && !this.get("dotEnvPath")) {
1391
+ let dotEnvPathFile = resolve(dotEnvPath, dotEnvFile);
1392
+ if (!existsSync(dotEnvPathFile) && !this.get("dotEnvPath")) {
1398
1393
  const examplesPath = resolve(dotEnvPath, "examples");
1399
- const examplesEnvSpecificPath = resolve(examplesPath, envSpecificFile);
1400
- if (existsSync(examplesEnvSpecificPath)) {
1401
- dotEnvPathFile = examplesEnvSpecificPath;
1402
- }
1403
- }
1404
- if (!dotEnvPathFile) {
1405
- dotEnvPathFile = resolve(dotEnvPath, dotEnvFile);
1406
- if (!existsSync(dotEnvPathFile)) {
1407
- if (!this.get("dotEnvPath")) {
1408
- const examplesPath = resolve(dotEnvPath, "examples");
1409
- const examplesEnvFile = resolve(examplesPath, dotEnvFile);
1410
- if (existsSync(examplesEnvFile)) {
1411
- dotEnvPathFile = examplesEnvFile;
1412
- } else {
1413
- dotEnvPathFile = resolve(dotEnvPath, "..", dotEnvFile);
1414
- }
1415
- }
1394
+ const examplesEnvFile = resolve(examplesPath, dotEnvFile);
1395
+ if (existsSync(examplesEnvFile)) {
1396
+ dotEnvPathFile = examplesEnvFile;
1397
+ } else {
1398
+ dotEnvPathFile = resolve(dotEnvPath, "..", dotEnvFile);
1416
1399
  }
1417
1400
  }
1418
1401
  if (dotEnvPathFile && existsSync(dotEnvPathFile)) {
1419
1402
  config({ path: dotEnvPathFile, quiet: true });
1420
1403
  }
1404
+ const envSpecificFile = `.env.${this.env}`;
1405
+ const envSpecificPath = resolve(dotEnvPath, envSpecificFile);
1406
+ if (existsSync(envSpecificPath) && envSpecificPath !== dotEnvPathFile) {
1407
+ config({ path: envSpecificPath, quiet: true });
1408
+ } else if (!this.get("dotEnvPath")) {
1409
+ const examplesOverlay = resolve(dotEnvPath, "examples", envSpecificFile);
1410
+ if (existsSync(examplesOverlay)) {
1411
+ config({ path: examplesOverlay, quiet: true });
1412
+ }
1413
+ }
1421
1414
  }
1422
1415
  /**
1423
1416
  * Load configuration files
@@ -5824,6 +5817,8 @@ module.exports = {
5824
5817
  merge_logs: true,
5825
5818
  time: true,
5826
5819
  env: {
5820
+ // cli-toolkit Args: ENV selects env-suffixed defaults (DB_NAME_PRODUCTION, BUCKET_PRODUCTION, \u2026)
5821
+ ENV: "production",
5827
5822
  NODE_ENV: "production",
5828
5823
  },
5829
5824
  },