36 lines
874 B
Bash
Executable File
36 lines
874 B
Bash
Executable File
#!/bin/bash
|
|
|
|
ABRA_VERSION="0.7.0"
|
|
GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
|
|
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
|
|
ABRA_DIR="${ABRA_DIR:+$ABRA_DIR}"
|
|
|
|
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 "$ABRA_DIR/"
|
|
if [[ ! -d "$ABRA_DIR/src" ]]; then
|
|
git clone "$GIT_URL" "$ABRA_DIR/src"
|
|
fi
|
|
(cd "$ABRA_DIR/src" && git pull origin main && cd - || exit)
|
|
mkdir -p "$HOME/.local/bin"
|
|
ln -sf "$ABRA_DIR/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
|