Skip to content

Commit

Permalink
fix: resolve deno from the default install location if it's not on th…
Browse files Browse the repository at this point in the history
…e PATH (#684)
  • Loading branch information
dsherret authored Jun 27, 2022
1 parent 196a11c commit 004e268
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ async function getDefaultDenoCommand() {
const denoCmd = "deno";
const pathValue = process.env.PATH ?? "";
const pathFolderPaths = splitEnvValue(pathValue);
// resolve the default install location in case it's not on the PATH
pathFolderPaths.push(getUserDenoBinDir());
const pathExts = getPathExts();
const cmdFileNames = pathExts == null
? [denoCmd]
Expand Down Expand Up @@ -96,6 +98,10 @@ async function getDefaultDenoCommand() {
.map((item) => item.trim())
.filter((item) => item.length > 0);
}

function getUserDenoBinDir() {
return path.join(os.homedir(), ".deno", "bin");
}
}

function fileExists(executableFilePath: string): Promise<boolean> {
Expand Down

1 comment on commit 004e268

@aslilac
Copy link

Choose a reason for hiding this comment

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

No love for Homebrew? 🥲

Please sign in to comment.