The easiest way to install gdpack
is by using the pre-built binaries. These can be manually downloaded and configured, but automated installation scripts are provided and recommended.
Alternatively, you can install gdpack
from source using the latest supported version of Rust. See Install from source for more details.
⚠️ WARNING: It's good practice to inspect an installation script prior to execution. The scripts are included in this repository and can be reviewed prior to use.
curl https://raw.githubusercontent.com/coffeebeats/gdpack/main/scripts/install.sh | sh
If you're using Git BASH for Windows follow the recommended Linux/MacOS instructions.
❕ NOTE: In order to run scripts in PowerShell, the execution policy must not be
Restricted
. Consider running the following command if you encounterUnauthorizedAccess
errors when following these instructions. See Set-ExecutionPolicy documentation for details.Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Invoke-WebRequest `
-UseBasicParsing `
-Uri "https://raw.githubusercontent.com/coffeebeats/gdpack/main/scripts/install.ps1" `
-OutFile "./install-gdpack.ps1"; `
&"./install-gdpack.ps1"; `
Remove-Item "./install-gdpack.ps1"
❕ NOTE: The instructions below provide
bash
-specific commands for a Linux-based system. While these won't work in Powershell, the process will be similar.
-
Download a prebuilt binary from the corresponding GitHub release. Set
VERSION
,OS
, andARCH
to the desired values.VERSION=0.0.0 OS=linux ARCH=x86_64; \ curl -LO https://github.com/coffeebeats/gdpack/releases/download/v$VERSION/gdpack-$VERSION-$OS-$ARCH.tar.gz
-
Extract the downloaded archive. To customize the
gdpack
install location, setGDPACK_HOME
to the desired location (defaults to$HOME/.gdpack
on Linux/MacOS).GDPACK_HOME=$HOME/.gdpack; \ mkdir -p $GDPACK_HOME/bin && \ tar -C $GDPACK_HOME/bin -xf gdpack-$VERSION-$OS-$ARCH.tar.gz
-
Export the
GDPACK_HOME
environment variable and add$GDPACK_HOME/bin
toPATH
. Add the following to your shell profile script (e.g. in.bashrc
,.zshenv
,.profile
, or something similar).export GDPACK_HOME="$HOME/.gdpack" export PATH="$GDPACK_HOME/bin:$PATH"
gdpack
is a Rust project and can be installed using cargo build
. This option is not recommended as it requires having the Rust toolchain installed, it's slower than downloading a prebuilt binary, and there may be instability due to using a different version of Rust than it was developed with.
cargo install --git github.com/coffeebeats/gdpack/cmd/gdpack --tag v0.3.1 # x-release-please-version
Once gdpack
is installed a few things need to be configured. Follow the instructions below based on your operating system.
-
Export the
GDPACK_HOME
environment variable and add$GDPACK_HOME/bin
to thePATH
environment variable.Add the following to your shell's profile script/RC file:
export GDPACK_HOME="$HOME/.gdpack" export PATH="$GDPACK_HOME/bin:$PATH"
-
Export the
GDPACK_HOME
environment variable using the following:$GdPackHomePath = "${env:LOCALAPPDATA}\gdpack" # Replace with whichever path you'd like. [System.Environment]::SetEnvironmentVariable("GDPACK_HOME", $GdPackHomePath, "User")
-
Add
$GDPACK_HOME/bin
to yourPATH
environment variable:❕ NOTE: Make sure to restart your terminal after the previous step so that any changes to
$GDPACK_HOME
have been updated.$PathParts = [System.Environment]::GetEnvironmentVariable("PATH", "User").Trim(";") -Split ";" $PathParts = $PathParts.where{ $_ -ne "${env:GDPACK_HOME}\bin" } $PathParts = $PathParts + "${env:GDPACK_HOME}\bin" [System.Environment]::SetEnvironmentVariable("PATH", $($PathParts -Join ";"), "User")