Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/cmake-rn/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,17 @@ export const program = new Command("cmake-rn")
triplets.add("arm64-apple-ios-sim");
}
}
console.error(
chalk.yellowBright("ℹ"),
"Using default triplets",
chalk.dim("(" + [...triplets].join(", ") + ")")
);
if (triplets.size === 0) {
throw new Error(
"Found no default triplets: Install some platform specific build tools"
);
Comment on lines +147 to +149
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using commander’s program.error() or printing a clear message with console.error() followed by process.exit(1) instead of throwing a raw Error, to avoid exposing a stack trace in normal CLI usage.

Suggested change
throw new Error(
"Found no default triplets: Install some platform specific build tools"
);
console.error(
chalk.redBright("✖"),
"Found no default triplets: Install some platform specific build tools"
);
process.exit(1);

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to postpone this to another PR copying the error handling from ferric somewhere shared between the different CLIs:

if (error instanceof UsageError || error instanceof SpawnFailure) {
console.error(chalk.red("ERROR"), error.message);
if (error.cause instanceof Error) {
console.error(chalk.red("CAUSE"), error.cause.message);
}
if (error instanceof UsageError && error.fix) {
console.error(
chalk.green("FIX"),
error.fix.command
? chalk.dim("Run: ") + error.fix.command
: error.fix.instructions
);
}
} else {

} else {
console.error(
chalk.yellowBright("ℹ"),
"Using default triplets",
chalk.dim("(" + [...triplets].join(", ") + ")")
);
}
}

const tripletContext = [...triplets].map((triplet) => {
Expand Down
Loading