shelljs / shelljs/shelljs

The cd command can report an incorrect error when executing in a worker

Open
#1,112 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
14.4k
Forks
756
PR merge metrics
No merged PRs in 30d

Description

Node version (or tell us if you're using electron or some other framework):

v16.14.2

ShellJS version (the most recent version/Github branch you see the bug on):

v0.8.5

Operating system:

Mac

Description of the bug:

When trying to use shell.cd within a worker specifying a folder which does exist, the cd command fails with the following error:

not a directory: foo

However, the underlying process.chdir command that shell uses, reports the following:

process.chdir() is not supported in workers

Contributor guide

Open the contributing guide

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

Begin at the shell.cd entry point and trace how process.chdir errors are converted when cd runs in a worker. Done means a nonexistent-directory error remains accurate while worker execution reports that process.chdir is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.