@kuckit/cli 4.0.0 → 4.0.2

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/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as isLegacyConfig, c as loadTryLoadKuckitConfig, i as isGcpConfig, l as addModule, o as migrateLegacyConfig, s as discoverModules, u as generateModule } from "./provider-oYp8e7KT.js";
2
+ import { a as isLegacyConfig, c as loadTryLoadKuckitConfig, i as isGcpConfig, l as addModule, o as migrateLegacyConfig, s as discoverModules, u as generateModule } from "./provider-CBgwQ7UE.js";
3
3
  import { program } from "commander";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import { spawn } from "node:child_process";
@@ -2652,7 +2652,14 @@ async function findProjectRoot$4(cwd) {
2652
2652
  }
2653
2653
  return null;
2654
2654
  }
2655
- async function loadConfig$4(projectRoot) {
2655
+ async function loadConfig$4(projectRoot, env) {
2656
+ if (env) {
2657
+ const envConfigPath = join$1(projectRoot, KUCKIT_DIR$4, `infra.${env}.json`);
2658
+ if (await fileExists$4(envConfigPath)) try {
2659
+ const content = await readFile(envConfigPath, "utf-8");
2660
+ return JSON.parse(content);
2661
+ } catch {}
2662
+ }
2656
2663
  const configPath = join$1(projectRoot, KUCKIT_DIR$4, CONFIG_FILE$4);
2657
2664
  if (!await fileExists$4(configPath)) return null;
2658
2665
  try {
@@ -2673,7 +2680,7 @@ async function getJobContext(options) {
2673
2680
  console.error("Error: Could not find project root (no package.json found)");
2674
2681
  process.exit(1);
2675
2682
  }
2676
- const config = await loadConfig$4(projectRoot);
2683
+ const config = await loadConfig$4(projectRoot, options.env);
2677
2684
  if (!config) {
2678
2685
  console.error("Error: No infrastructure configuration found.");
2679
2686
  console.error("Run: kuckit infra init");