You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ShellJS is designed to operate on environmental variables, which are global state. I glanced at https://nodejs.org/api/worker_threads.html#class-worker, but unfortunately it looks like this doesn't allow code in workers to modify global state in this way. This doesn't seem like something we can support unfortunately.
I agree the error message is misleading. I'll keep this issue open to detect this case and print a more reasonable error message.
The current implementation of cd.js is swallowing the actual error. The exception caught in line 27 (e) is not logged nor used further in the the error handling. This hides errors such as chdir not supported in worker threads or other causes not covered by the current handling error code in this file.
I still agree we need to surface this error message better. I'm open to suggestions (or PRs) to improve the error handling.
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, thecd
command fails with the following error:However, the underlying
process.chdir
command that shell uses, reports the following:The text was updated successfully, but these errors were encountered: