@nmakarov/cli-toolkit 0.55.0 → 0.59.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.
@@ -1132,6 +1132,10 @@ var Args = class _Args {
1132
1132
  this.parseArgs(args);
1133
1133
  this.env = this.get("env")?.toLowerCase() || "local";
1134
1134
  this.loadDotEnv();
1135
+ const envAfterDotEnv = this.get("env")?.toLowerCase();
1136
+ if (envAfterDotEnv) {
1137
+ this.env = envAfterDotEnv;
1138
+ }
1135
1139
  this.loadConfigFiles();
1136
1140
  this.checkConflicts();
1137
1141
  if (context && typeof context.registerCleanup === "function") {
@@ -2863,6 +2867,12 @@ var Db = class _Db {
2863
2867
  }
2864
2868
  if (!dbConnectionString) {
2865
2869
  if (!dbName) {
2870
+ const env = context?.args?.env;
2871
+ if (env && String(env).toLowerCase() !== "local") {
2872
+ throw new ParamError(
2873
+ `Db: dbName not set for env="${env}" (set --dbName or DB_NAME_${String(env).toUpperCase()})`
2874
+ );
2875
+ }
2866
2876
  dbName = "local";
2867
2877
  }
2868
2878
  const paramName = `dbConnectionString${capitalizeFirstLetter(dbName)}`;