Skip to content

Commit fc35ac8

Browse files
authored
Merge pull request #48 from pkgxdev/require-sudo-upfront
`sudo pkgm install` not `pkgm local-install`
2 parents 69a0a83 + 15d60d7 commit fc35ac8

File tree

3 files changed

+142
-183
lines changed

3 files changed

+142
-183
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,29 @@ jobs:
3535
- uses: actions/checkout@v4
3636
- uses: pkgxdev/setup@v3
3737

38-
- run: |
39-
if [[ "$(/usr/local/bin/pkgx --version)" != "pkgx 2"* ]]; then
40-
exit 1
41-
fi
42-
4338
- run: ./pkgm.ts i git
44-
- run: /usr/local/bin/git --version
45-
- run: ./pkgm.ts ls | grep /usr/local/pkgs/git-scm.org
39+
- run: ~/.local/bin/git --version
40+
- run: "! test -f /usr/local/bin/git"
41+
- run: ./pkgm.ts ls | grep .local/pkgs/git-scm.org
4642
- run: ./pkgm.ts rm git
47-
- run: test ! -f /usr/local/bin/git
43+
- run: test ! -f ~/.local/bin/git
4844

4945
- run: ./pkgm.ts i pkgx.sh/brewkit
50-
- run: /usr/local/bin/bk --help
46+
- run: ~/.local/bin/bk --help
5147

5248
# check repeats work
53-
- run: rm /usr/local/bin/bk
49+
- run: rm ~/.local/bin/bk
5450
- run: test ! -f /usr/local/bin/bk
5551
- run: ./pkgm.ts i pkgx.sh/brewkit
56-
- run: /usr/local/bin/bk --help
52+
- run: ~/.local/bin/bk --help
5753

58-
- run: ./pkgm.ts li gum
54+
- run: ./pkgm.ts i gum
5955
- run: ~/.local/bin/gum --version
6056

57+
# test a thing with deps
6158
# https://github.com/pkgxdev/pkgm/issues/24
6259
- run: ./pkgm.ts i curl
63-
- run: /usr/local/bin/curl -L pkgx.sh
60+
- run: ~/.local/bin/curl -L pkgx.sh
6461

6562
- run: ./pkgm.ts shim semverator
6663
- run: ~/.local/bin/semverator validate 1.0.0

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ Install `pkgx` packages to `/usr/local`.
1616

1717
```sh
1818
$ pkgm install git
19-
# ^^ installs latest git
19+
# ^^ installs latest git to ~/.local. ie. you get ~/.local/bin/git
2020

2121
$ pkgm install git@2.41
2222
# ^^ installs git^2.41 or switches out the installed git to 2.41
2323

2424
$ pkgm uninstall git
2525

26-
$ pkgm local-install git
27-
# ^^ installs git to ~/.local. ie. you get ~/.local/bin/git
28-
# `pkgm li git` is easier to type and remember
26+
$ sudo pkgm install git
27+
# ^^ installs git to /usr/local. ie. you get /usr/local/bin/git
2928

3029
$ pkgm shim git
3130
# ^^ creates a shim for git in ~/.local/bin
@@ -40,7 +39,10 @@ $ pkgm outdated
4039
# ^^ lists outdated installations
4140

4241
$ pkgm update
43-
# ^^ updates installed packages to latest versions
42+
# ^^ updates ~/.local packages to latest versions
43+
44+
$ sudo pkgm update
45+
# ^^ updates /usr/local packages to latest versions
4446

4547
$ pkgm pin git
4648
# ^^ prevents the installed git from being updated

0 commit comments

Comments
 (0)