@moda-ai/cli 1.13.4 → 1.13.5
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/init/index.js
CHANGED
|
@@ -85,7 +85,12 @@ export async function runInit(flags, options = {}) {
|
|
|
85
85
|
// --tenant-id flag wins over MODA_TENANT_ID; the source drives the
|
|
86
86
|
// env-shadow warning so we don't warn when the env var was the selection.
|
|
87
87
|
const tenantIdFlag = stringFlag(flagValue(flags, 'tenant-id', 'tenant_id'));
|
|
88
|
-
|
|
88
|
+
// Normalize the env var the same way as the flag: an empty/whitespace
|
|
89
|
+
// MODA_TENANT_ID (e.g. `export MODA_TENANT_ID=`, or a harness that blanks it
|
|
90
|
+
// to clear an inherited value) means "unset", not an explicit empty-id
|
|
91
|
+
// selection — otherwise the exact-id match below fails with
|
|
92
|
+
// "No organization with id ''" instead of auto-selecting a sole org.
|
|
93
|
+
const tenantIdEnv = stringFlag(process.env.MODA_TENANT_ID);
|
|
89
94
|
const { apiKey, tenantName } = await selectTenantAndCreateKey({
|
|
90
95
|
tenantId: tenantIdFlag ?? tenantIdEnv,
|
|
91
96
|
tenantIdSource: tenantIdFlag ? 'flag' : tenantIdEnv ? 'env' : undefined,
|
package/package.json
CHANGED