Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fs): add lookPath function #1057

Closed
wants to merge 2 commits into from

Conversation

wperron
Copy link
Contributor

@wperron wperron commented Jul 22, 2021

Port of the [lookPath][1] function from Go's exec package. Fixes #1056.

[1]https://pkg.go.dev/os/exec#example-LookPath

@wperron
Copy link
Contributor Author

wperron commented Jul 22, 2021

Still need to add some tests, especially for Windows

@nhrones
Copy link

nhrones commented Jul 22, 2021

@wperron Let me know if I can help validate anything on Windows.

async function chkStat(file: string) {
const s = await Deno.stat(file);
if (s.isDirectory) {
throw new Deno.errors.PermissionDenied(file);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to give more descriptive error message? somthing like ${file} is a directory

Port of the [lookPath][1] function from Go's exec package. Fixes denoland#1056.

[1]https://pkg.go.dev/os/exec#example-LookPath
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bartlomieju
Copy link
Member

This is stale and not close to landing. I'm going to close it for now, if anyone feels like picking it up, feel free to open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add lookPath function to find the path of an executable
5 participants