Skip to content

Commit

Permalink
fix: wrong env var for (self-)update
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Jan 3, 2025
1 parent 0402931 commit db21022
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log (go-package-manager)

## 0.29.4
## 0.29.5

- feat: self-update by executing `gpm update --self`
- chore: improve (self-)update scripts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ gpm update --self

if you have a valid [sh](https://en.wikipedia.org/wiki/Unix_shell) or [PowerShell](https://en.wikipedia.org/wiki/PowerShell) installed.

You are able to customize final directory with `GPM_BIN_PATH`, which is `C:\Program Files\gpm` on Windows and `/usr/local/bin` on POSIX-like systems by default e.g.
You are able to customize final directory with `GPM_INSTALL_PATH`, which is `C:\Program Files\gpm` on Windows and `/usr/local/bin` on POSIX-like systems by default e.g.

## Usage [<a href="#table-of-contents">↑</a>]

Expand Down
2 changes: 1 addition & 1 deletion sh.kloubert.dev/gpm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ try {
Handle-Error "Could not extract 'gpm.exe' binary"
}

$DefaultDestination = $env:GPM_BIN_PATH
$DefaultDestination = $env:GPM_INSTALL_PATH
if ([string]::IsNullOrWhiteSpace($DefaultDestination)) {
$DefaultDestination = "C:\\Program Files\\gpm\\gpm.exe"
}
Expand Down
8 changes: 4 additions & 4 deletions sh.kloubert.dev/gpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ handle_error() {
echo "Go Package Manager Updater"
echo ""

GPM_BIN_PATH=${GPM_BIN_PATH:-/usr/local/bin}
GPM_INSTALL_PATH=${GPM_INSTALL_PATH:-/usr/local/bin}

case "$(uname -s)" in
Darwin)
Expand Down Expand Up @@ -89,9 +89,9 @@ shasum -a 256 gpm.tar.gz.sha256 || handle_error "SHA256 verification failed"
echo "Extracting binary ..."
tar -xzOf gpm.tar.gz gpm > gpm || handle_error "Could not extract 'gpm' binary"

echo "Installing 'gpm' to $GPM_BIN_PATH ..."
sudo mv gpm "$GPM_BIN_PATH/gpm" || handle_error "Could not move 'gpm' to '$GPM_BIN_PATH'"
sudo chmod +x "$GPM_BIN_PATH/gpm" || handle_error "Could not update permissions of 'gpm' binary"
echo "Installing 'gpm' to $GPM_INSTALL_PATH ..."
sudo mv gpm "$GPM_INSTALL_PATH/gpm" || handle_error "Could not move 'gpm' to '$GPM_INSTALL_PATH'"
sudo chmod +x "$GPM_INSTALL_PATH/gpm" || handle_error "Could not update permissions of 'gpm' binary"

echo "Cleaning up ..."
rm gpm.tar.gz gpm.tar.gz.sha256 || handle_error "Cleanups failed"
Expand Down

0 comments on commit db21022

Please sign in to comment.