Skip to content

Commit bd56a00

Browse files
scidominogemini-cli-robot
authored andcommitted
fix: "allow always" for commands with paths (#23558)
1 parent 7f8fb6f commit bd56a00

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

packages/core/src/utils/shell-utils.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ describe('getCommandRoots', () => {
119119
expect(getCommandRoots('ls -l')).toEqual(['ls']);
120120
});
121121

122-
it('should handle paths and return the binary name', () => {
123-
expect(getCommandRoots('/usr/local/bin/node script.js')).toEqual(['node']);
122+
it('should handle paths and return the full path', () => {
123+
expect(getCommandRoots('/usr/local/bin/node script.js')).toEqual([
124+
'/usr/local/bin/node',
125+
]);
124126
});
125127

126128
it('should return an empty array for an empty string', () => {

packages/core/src/utils/shell-utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,7 @@ function normalizeCommandName(raw: string): string {
264264
return raw.slice(1, -1);
265265
}
266266
}
267-
const trimmed = raw.trim();
268-
if (!trimmed) {
269-
return trimmed;
270-
}
271-
return trimmed.split(/[\\/]/).pop() ?? trimmed;
267+
return raw.trim();
272268
}
273269

274270
function extractNameFromNode(node: Node): string | null {

0 commit comments

Comments
 (0)