fix(patch): cherry-pick daf3691 to release/v0.35.0-preview.2-pr-23558 to patch version v0.35.0-preview.2 and create version 0.35.0-preview.3 (#23565)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
gemini-cli-robot
2026-03-23 11:16:13 -07:00
committed by GitHub
parent 7f8fb6f292
commit d1de82c46f
2 changed files with 5 additions and 7 deletions
+4 -2
View File
@@ -119,8 +119,10 @@ describe('getCommandRoots', () => {
expect(getCommandRoots('ls -l')).toEqual(['ls']);
});
it('should handle paths and return the binary name', () => {
expect(getCommandRoots('/usr/local/bin/node script.js')).toEqual(['node']);
it('should handle paths and return the full path', () => {
expect(getCommandRoots('/usr/local/bin/node script.js')).toEqual([
'/usr/local/bin/node',
]);
});
it('should return an empty array for an empty string', () => {
+1 -5
View File
@@ -264,11 +264,7 @@ function normalizeCommandName(raw: string): string {
return raw.slice(1, -1);
}
}
const trimmed = raw.trim();
if (!trimmed) {
return trimmed;
}
return trimmed.split(/[\\/]/).pop() ?? trimmed;
return raw.trim();
}
function extractNameFromNode(node: Node): string | null {