| 54 | skipSkillInstall: options.skipSkillInstall, |
| 55 | }); |
| 56 | } catch (err) { |
| 57 | console.error(chalk.red(`Packaging failed: ${err}`)); |
| 58 | process.exit(1); |
| 59 | } |
| 60 | }); |
| 61 | |
| 62 | function normalizeUserArgs(argv: string[]): string[] { |
| 63 | if (argv.length === 0) return argv; |
| 64 | |
| 65 | // In some Electron fork setups, cli path is injected into user args. |
| 66 | // Strip the duplicated CLI path so commander sees the real command first. |
| 67 | const firstArg = argv[0]; |
| 68 | if (firstArg && path.resolve(firstArg) === cliFilePath) { |
| 69 | return argv.slice(1); |