Skip to content

Commit d3aec8c

Browse files
committed
wip
1 parent d9b54ad commit d3aec8c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ brew rm pkgm || sudo rm /usr/local/bin/pkgm
8787
- Blazingly fast
8888
- Install specific versions of any pkg
8989
- You install by executable name—thus you _don’t have to do a search first_
90-
- Installed packages are installed as `root`
90+
- Installed packages can be installed as `root`
91+
- `dev`-aware installations
92+
- Self-healing shims

pkgm.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ function install_prefix() {
740740
}
741741

742742
function dev_stub_text(selfpath: string, bin_prefix: string, name: string) {
743-
return `
743+
if (selfpath.startsWith("/usr/local")) {
744+
return `
744745
dev_check() {
745746
[ -x /usr/local/bin/dev ] || return 1
746747
local d="$PWD"
@@ -754,13 +755,18 @@ dev_check() {
754755
return 1
755756
}
756757
758+
set -x
759+
757760
if d="$(dev_check)"; then
758761
eval "$(/usr/local/bin/dev "$d" 2>/dev/null)"
759762
[ "$(command -v ${name} 2>/dev/null)" != "${selfpath}" ] && exec ${name} "$@"
760763
fi
761764
762765
exec ${bin_prefix}/${name} "$@"
763766
`.trim();
767+
} else {
768+
return `exec ${bin_prefix}/${name} "$@"`;
769+
}
764770
}
765771

766772
function datadir() {

0 commit comments

Comments
 (0)