An unset variable in path: puts the working directory on PATH
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli, testing-qa
Research direction
Locate the code that expands path: entries and inspect how unset variables become PATH elements. Add the proposed test using a bare $VAR, then verify that an empty expansion is omitted and the working directory is not searched; the test should produce a clear command-not-found result.
Written by the indexing model from the issue text.
Description
An unset variable in a path: entry expands to an empty string, and an empty PATH
element means the current directory to POSIX. So this front matter:
path:
- $TOOL_DIR
silently puts the working directory on PATH when TOOL_DIR is not set, instead of
contributing nothing.
That is the wrong failure. A test that names a directory it cannot resolve should get a
clear "command not found", not a lookup that quietly searches somewhere the author never
named — and in a sandboxed run the working directory contains fixtures, which is exactly
where a stray executable could sit.
Proposal
Drop entries that expand to empty, rather than passing them through.
A test asserting that a bare $VAR does not put the working directory on PATH would pin
it: today that assertion fails.
Related
jlevy/tryscript#54 asks for requires:, which addresses the same underlying problem from
the other side — knowing which binary a run actually resolved rather than trusting PATH
composition to have gone as intended.
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 1
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jlevy/tryscript
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100