Download
Download anchor binary / source-files to any environment, local or CI.
Package Managers
Pull in anchor’s binary using popular package managers.
Homebrew
The fastest way (for macOS and Linux) to install anchor is using Homebrew:
brew install ZachiNachshon/tap/anchor
Alternatively, tap into the formula to have brew search capabilities on that tap formulas:
-
Tap into
ZachiNachshonformulabrew tap ZachiNachshon/tap -
Install the latest
anhcorbinarybrew install anchor
Pre-Built Release
-
Update the download script with the following parameters:
- VERSION: binary released version
- OS_ARCH: operating system & architecture tuple
-
Download and install
anchorbinary (copy & paste into a terminal):
bash <<'EOF'
# Change Version, OS and Architecture accordingly
VERSION=0.1.0
OS_ARCH=darwin_amd64
# Options:
# - darwin_arm64
# - linux_arm64
# - linux_armv6
# - linux_amd64
# Create a temporary folder
repo_temp_path=$(mktemp -d ${TMPDIR:-/tmp}/anchor-repo.XXXXXX)
cwd=$(pwd)
cd ${repo_temp_path}
# Download & extract
echo -e "\nDownloading anchor to temp directory...\n"
curl -SL "https://github.com/ZachiNachshon/anchor/releases/download/v${VERSION}/anchor_${VERSION}_${OS_ARCH}.tar.gz" | tar -xz
# Create a dest directory and move the binary
echo -e "\nMoving binary to ~/.local/bin"
mkdir -p ${HOME}/.local/bin; mv anchor ${HOME}/.local/bin
# Add this line to your *rc file (zshrc, bashrc etc..) to make `anchor` available on new sessions
echo "Exporting ~/.local/bin (make sure to have it available on PATH)"
export PATH="${PATH}:${HOME}/.local/bin"
cd ${cwd}
# Cleanup
if [[ ! -z ${repo_temp_path} && -d ${repo_temp_path} && ${repo_temp_path} == *"anchor-repo"* ]]; then
echo "Deleting temp directory"
rm -rf ${repo_temp_path}
fi
echo -e "\nDone (type 'anchor' for help)\n"
EOF
Alternatively, you can download a release directy from GitHub
PATH awareness
Make sure ${HOME}/.local/bin exists on the PATH or sourced on every new shell session.
Build from Source
Clone anchor repository into a directory of your choice:
git clone https://github.com/ZachiNachshon/anchor.git; cd anchor
Build to Custom Path
-
Change directory to the local
anchorcloned repository -
Build the binary (destination:
PWD)make build -
Copy the binary to a bin folder that exists on
PATHcp anchor ${HOME}/.local/bin -
(Optional) Alternatively, copy directly to
/usr/local/bincp anchor /usr/local/bin
PATH awareness
Make sure ${HOME}/.local/bin exists on the PATH or sourced on every new shell session.
Build to GOPATH
-
Change directory to the local
anchorcloned repository -
Build the binary (destination:
GOPATH/bin)make build-to-gopath