dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
1.02k stars 34 forks source link

Improve not found error when spawning and cwd does not exist #159

Closed dsherret closed 1 year ago

dsherret commented 1 year ago
$ deno run -A main.ts
> some_command
error: Uncaught (in promise) NotFound: Failed to spawn: ...: No such file or directory (os error 2)
  }).spawn();
     ^
    at spawnChildInner (ext:runtime/40_process.js:162:17)

This error is confusing. The some_command exists, but actually the cwd does not so it errors. In this case, the cwd should be checked on error to see if it exists and then provide a helpful error message.