mathisonian / mathisonian/command-exists

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

Open
#35 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
147
Forks
22
PR merge metrics
No merged PRs in 30d

Description

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..

```bash
/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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the commandExists implementation and reproduce the reported layout with a folder named myCommand. Verify that a directory with the command name is not treated as an existing command, while preserving the expected command lookup behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.