Add --dev to installer, to grab git version

This commit is contained in:
3wc 2021-03-14 14:39:11 +02:00
parent 8cb6617a0f
commit 88d2a75575

View File

@ -1,18 +1,30 @@
#!/bin/bash #!/bin/bash
ABRA_VERSION="0.5.0" ABRA_VERSION="0.5.0"
ABRA_SRC="https://git.autonomic.zone/coop-cloud/abra/raw/tag/$ABRA_VERSION/abra" GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
function install_abra { function install_abra_release {
mkdir -p "$HOME/.local/bin" mkdir -p "$HOME/.local/bin"
curl "$ABRA_SRC" > "$HOME/.local/bin/abra" curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
chmod +x "$HOME/.local/bin/abra" chmod +x "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra" echo "abra installed to $HOME/.local/bin/abra"
} }
function run_installation { function install_abra_dev {
install_abra mkdir -p "$HOME/.abra/"
git clone "$GIT_URL" "$HOME/.abra/src"
mkdir -p "$HOME/.local/bin"
ln -s "$HOME/.abra/src/abra" "$HOME/.local/bin/abra"
} }
run_installation function run_installation {
if [ "$1" = "--dev" ]; then
install_abra_dev
else
install_abra_release
fi
}
run_installation "$@"
exit 0 exit 0