Skip to content

Commit

Permalink
Uninstalling a package that is not install is not an error
Browse files Browse the repository at this point in the history
It's just a no-op
  • Loading branch information
andsens committed Nov 30, 2023
1 parent a236b90 commit 45eee74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Replace `bash -c ...` with `sudo bash -c ...` to install system-wide.
You can also paste this directly into a Dockerfile `RUN` command, no escaping needed.

```
bash -ec 'src=$(wget -qO- https://raw.githubusercontent.com/orbit-online/upkg/v0.12.2/upkg.sh); \
shasum -a 256 -c <(printf "49f54e5b53109270b71c20f124b9cfd8517bbfbd00c3569b854bc7d4c74d4b94 -") <<<"$src"; \
set - install -g orbit-online/upkg@v0.12.2; eval "$src"'
bash -ec 'src=$(wget -qO- https://raw.githubusercontent.com/orbit-online/upkg/v0.12.3/upkg.sh); \
shasum -a 256 -c <(printf "cd66df6dc96d4edf6dfb57c531da9c17653ea3482f5a270a03cd2211a3e3be00 -") <<<"$src"; \
set - install -g orbit-online/upkg@v0.12.3; eval "$src"'
```

Installation dependencies are `ca-certificates`, `wget`, and `shasum`.
Expand Down
2 changes: 1 addition & 1 deletion upkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ upkg_uninstall() {
local pkgname=${1:?} pkgspath=${2:?} binpath=${3:?} deps_to_remove=$4 dep
processing 'Uninstalling %s' "$pkgname"
local pkgpath="$pkgspath/$pkgname" asset command commands cmdpath
[[ -e "$pkgpath/upkg.json" ]] || fatal "'%s' is not installed" "$pkgname"
[[ -e "$pkgpath/upkg.json" ]] || { processing "'%s' is not installed" "$pkgname"; return 0; }
commands=$(jq -r '(.commands // {}) | to_entries[] | "\(.key)\n\(.value)"' <"$pkgpath/upkg.json")
while [[ -n $commands ]] && read -r -d $'\n' command; do
read -r -d $'\n' asset
Expand Down

0 comments on commit 45eee74

Please sign in to comment.