fix(install): error on mutually exclusive --sdk and --no-sdk flags

Previously passing both silently had --no-sdk win. Exit non-zero with
a clear error to match how other exclusive flag pairs (--global/--local,
--config-dir/--local) are handled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeremy McSpadden
2026-04-17 16:03:25 -05:00
parent 53b49dfe20
commit 08b1d8377d

View File

@@ -80,6 +80,11 @@ const hasPortableHooks = args.includes('--portable-hooks') || process.env.GSD_PO
const hasSdk = args.includes('--sdk');
const hasNoSdk = args.includes('--no-sdk');
if (hasSdk && hasNoSdk) {
console.error(` ${yellow}Cannot specify both --sdk and --no-sdk${reset}`);
process.exit(1);
}
// Runtime selection - can be set by flags or interactive prompt
let selectedRuntimes = [];
if (hasAll) {