Skip to content

Commit

Permalink
allow FORCE_INSTALL to replace binary without interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarreira committed Sep 9, 2024
1 parent a49f822 commit 8d39454
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ apply_env () {
check_preexisting_install () {
if [ -d "$INSTALL_DIR" ] && [ -f "$BIN_FILE" ]; then
echo "Found preexisting Terrabutler installation: $INSTALL_DIR."

if [ "${FORCE_INSTALL:-no}" == "yes" ] ; then
echo "Replacing preexisting Terrabutler installation (FORCE_INSTALL=yes)"
rm -rf "$INSTALL_DIR" "$BIN_FILE"
return
fi

read -r -p "Do you want to replace it? [y/N] " response
case "$response" in
[yY])
Expand Down Expand Up @@ -88,4 +95,4 @@ main () {
install
}

main "$@"
main "$@"

0 comments on commit 8d39454

Please sign in to comment.