fix: "allow always" for commands with paths (#23558)

This commit is contained in:
Tommaso Sciortino
2026-03-23 17:25:31 +00:00
committed by GitHub
parent 517961b2eb
commit daf3691841
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', () => {