diff --git a/install.sh b/install.sh index ed1d5fc..b90716c 100755 --- a/install.sh +++ b/install.sh @@ -8,6 +8,13 @@ set -e # 4. moves the bb64 binary to /usr/local/bin # 5. prints a message to the user +# 0. see if we were passed a folder to install to +# ----------------------------------------------------------------------------- +INSTALL_DIR=$1 +if [[ -z "$INSTALL_DIR" ]]; then + INSTALL_DIR="/usr/local/bin" +fi + # 1. Determine architecture # ----------------------------------------------------------------------------- @@ -37,12 +44,12 @@ chmod +x "$TMPDIR/bb64" # 5. Move to /usr/local/bin # ----------------------------------------------------------------------------- -docker run --rm -v "$TMPDIR:/tmp" -v /usr/local/bin:/target alpine sh -c "cp /tmp/bb64 /target/bb64" +docker run --rm -v "$TMPDIR:/tmp" -v "$INSTALL_DIR:/target" alpine sh -c "cp /tmp/bb64 /target/bb64" rm "$TMPDIR/bb64" # 6. Print success message # ----------------------------------------------------------------------------- -echo "bb64 installed successfully to /usr/local/bin/bb64 (arch $ARCH)" +echo "bb64 installed successfully to $INSTALL_DIR/bb64 (arch $ARCH)" echo " " echo "Update bb64 with:" echo " bb64 -u" diff --git a/install_prerequisites.sh b/install_prerequisites.sh index 9490aa6..6ecb12f 100755 --- a/install_prerequisites.sh +++ b/install_prerequisites.sh @@ -39,15 +39,15 @@ if [ ! -d "$INSTALL_DIR/aarch64-linux-musl-cross" ]; then fi # Print instructions for adding to PATH -cat <