Skip to content

Instantly share code, notes, and snippets.

@kdm9
Last active August 27, 2024 07:25
Show Gist options
  • Save kdm9/2c715a2e4fc1c4f93bb22c0beba6d73e to your computer and use it in GitHub Desktop.
Save kdm9/2c715a2e4fc1c4f93bb22c0beba6d73e to your computer and use it in GitHub Desktop.
a curl-pipe-sh for installing git-annex on linux amd64

A curl|sh for installing git-annex

Yes, this is a bad idea. Yes, everybody does it anyway.

curl -LSs https://gist.github.com/kdm9/2c715a2e4fc1c4f93bb22c0beba6d73e/raw/get-annex.sh | bash

will install git-annex standalone under ~/.local/opt, with symlinks to ~/.local/bin

#!/bin/bash
set -xe
mkdir -p ~/.local/opt
cd ~/.local/opt
wget -O git-annex-standalone-amd64.tar.gz https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
rm -rf git-annex.linux
tar xvf git-annex-standalone-amd64.tar.gz
mkdir -p ~/.local/bin
ln -sf $PWD/git-annex.linux/{git,git-annex,git-annex-shell,git-receive-pack,git-upload-pack,git-shell} ~/.local/bin
set +x
echo "$PATH" | grep "$HOME/.local/bin" &>/dev/null || echo "You must add ~/.local/bin/ to your PATH, e.g. with echo '"'export PATH="$HOME/.local/bin:$PATH"'"'>>~/.bashrc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment