supacloud 0.14.13 → 0.14.14

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/dist/index.js +9 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { spawn } from "node:child_process";
5
4
  import { existsSync, readFileSync, realpathSync } from "node:fs";
6
5
  import { createRequire } from "node:module";
7
6
  import { dirname, join, parse } from "node:path";
@@ -254,15 +253,16 @@ async function dispatchSubcommand(target, forwardedArgs) {
254
253
  const launchPlan = await createLaunchPlan(target, forwardedArgs);
255
254
  if (launchPlan.updateNotice)
256
255
  console.error(`ℹ️ ${launchPlan.updateNotice}`);
257
- const childProcess = spawn(launchPlan.command, launchPlan.args, {
258
- stdio: "inherit",
259
- shell: launchPlan.shell
260
- });
261
- childProcess.on("close", (code) => process.exit(code ?? 1));
262
- childProcess.on("error", (error) => {
263
- console.error(`❌ 启动 ${target.pkg} 失败: ${error.message}`);
256
+ try {
257
+ const childProcess = Bun.spawn([launchPlan.command, ...launchPlan.args], {
258
+ stdio: ["inherit", "inherit", "inherit"]
259
+ });
260
+ const exitCode = await childProcess.exited;
261
+ process.exit(exitCode ?? 1);
262
+ } catch (error) {
263
+ console.error(`❌ 启动 ${target.pkg} 失败: ${error.message || String(error)}`);
264
264
  process.exit(1);
265
- });
265
+ }
266
266
  }
267
267
  async function run(args) {
268
268
  const subcommandName = args[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supacloud",
3
- "version": "0.14.13",
3
+ "version": "0.14.14",
4
4
  "description": "Unified entrypoint: `supacloudctl cli` and `supacloudctl admin` in one command",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",