Skip to content

Commit

Permalink
warn if ~/.local/bin is not in PATH after install
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Nov 18, 2023
1 parent 45b3763 commit f05d6ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modes/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export default async function(pkgs: PackageRequirement[]) {
} catch (err) {
//FIXME we should check if /usr/local/bin is writable, but were having trouble with that
if (err instanceof Deno.errors.PermissionDenied) {
await write(Path.home().join(".local/bin"), pkgs)
const bindir = Path.home().join(".local/bin")
await write(bindir, pkgs)
if (n > 0 && !Deno.env.get("PATH")?.split(":").includes(bindir.string)) {
console.warn("pkgx: %c`%s` is not in `PATH`", 'color: red', bindir)
}
} else {
throw err
}
Expand Down

0 comments on commit f05d6ce

Please sign in to comment.