Skip to content

Commit bd4e24f

Browse files
committed
warn if ~/.local/bin is not in PATH after install
1 parent a834146 commit bd4e24f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/modes/install.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export default async function(pkgs: PackageRequirement[]) {
1515
} catch (err) {
1616
//FIXME we should check if /usr/local/bin is writable, but were having trouble with that
1717
if (err instanceof Deno.errors.PermissionDenied) {
18-
await write(Path.home().join(".local/bin"), pkgs)
18+
const bindir = Path.home().join(".local/bin")
19+
await write(bindir, pkgs)
20+
if (n > 0 && !Deno.env.get("PATH")?.split(":").includes(bindir.string)) {
21+
console.warn("pkgx: %c`%s` is not in `PATH`", 'color: red', bindir)
22+
}
1923
} else {
2024
throw err
2125
}

0 commit comments

Comments
 (0)