command-exists icon indicating copy to clipboard operation
command-exists copied to clipboard

False positive if there is a folder with the same name as the command in question

Open macCesar opened this issue 3 years ago • 4 comments

Hi there...

I'm trying your module.. But it throws false positives when testing for a command with the same name as a folder at the testing location...

For example..

/myProject
  /myFolderName
  /anotherFolder
  /myCommand <-- folder with the same name as the command.

If I test commandExists('myCommand') inside myProject it will throw true because of the folder with the same name as the command.

macCesar avatar Mar 26 '22 20:03 macCesar

Is there a way to ask for the command in a particular location ??

I need to check if myCommand is installed globally in /node_modules/myCommand

macCesar avatar Mar 26 '22 21:03 macCesar

@macCesar did this occur on linux on mac for you ?

rbbl-dev avatar Mar 28 '22 21:03 rbbl-dev

Hi... I'm testing it on a Mac...

But it needs to work on the 3 main systems.. Linux, Windows and Mac.

macCesar avatar Mar 29 '22 00:03 macCesar

Sry it was late :D

I've opened #36 yesterday. the testcase and fix i've added works on linux but the pipeline fails on mac and i'm not too sure why.

rbbl-dev avatar Mar 29 '22 08:03 rbbl-dev