This repository has been archived on 2021-07-03. You can view files and clone it, but cannot push or open issues or pull requests.
abra/installer/installer
2021-03-17 12:54:29 +01:00

35 lines
843 B
Bash
Executable File

#!/bin/bash
ABRA_VERSION="0.6.0"
GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
function install_abra_release {
mkdir -p "$HOME/.local/bin"
curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
chmod +x "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra"
}
function install_abra_dev {
mkdir -p "$HOME/.abra/"
if [[ ! -d "$HOME/.abra/src" ]]; then
git clone "$GIT_URL" "$HOME/.abra/src"
fi
( cd "$HOME/.abra/src" && git pull origin main && cd -)
mkdir -p "$HOME/.local/bin"
ln -sf "$HOME/.abra/src/abra" "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra (development bleeding edge)"
}
function run_installation {
if [ "$1" = "--dev" ]; then
install_abra_dev
else
install_abra_release
fi
}
run_installation "$@"
exit 0