We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12c1d45 commit 1e0fecdCopy full SHA for 1e0fecd
1 file changed
app/utils/run-command.ts
@@ -81,13 +81,14 @@ export function getExecutableInfo(
81
82
// Object format: keys are command names
83
const commands = Object.keys(bin)
84
- if (commands.length === 0) {
+ const firstCommand = commands[0]
85
+ if (!firstCommand) {
86
return { primaryCommand: '', commands: [], hasExecutable: false }
87
}
88
89
// Prefer command matching package name if it exists, otherwise use first
90
const baseName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName
- const primaryCommand = commands.includes(baseName) ? baseName : commands[0]
91
+ const primaryCommand = baseName && commands.includes(baseName) ? baseName : firstCommand
92
93
return {
94
primaryCommand,
0 commit comments