From 0f437de869cc3072261e3efd497f86dfac6c1077 Mon Sep 17 00:00:00 2001 From: Zack Brady Date: Sat, 2 Nov 2024 15:17:51 -0400 Subject: [PATCH] updated hauler directory for the install script --- install.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index f0e4958..f252819 100755 --- a/install.sh +++ b/install.sh @@ -17,6 +17,10 @@ # - curl -sfL https://get.hauler.dev | HAULER_INSTALL_DIR=/usr/local/bin bash # - HAULER_INSTALL_DIR=/usr/local/bin ./install.sh # +# Set Hauler Directory +# - curl -sfL https://get.hauler.dev | HAULER_DIR=$HOME/hauler bash +# - HAULER_DIR=$HOME/hauler ./install.sh +# # Debug Usage: # - curl -sfL https://get.hauler.dev | HAULER_DEBUG=true bash # - HAULER_DEBUG=true ./install.sh @@ -83,7 +87,7 @@ if [ "${HAULER_UNINSTALL}" = "true" ]; then rm -rf "${HAULER_INSTALL_DIR}/hauler" || fatal "Failed to Remove Hauler from ${HAULER_INSTALL_DIR}" # remove the working directory - rm -rf "$HOME/.hauler" || fatal "Failed to Remove Hauler Directory: $HOME/.hauler" + rm -rf "$HAULER_DIR" || fatal "Failed to Remove Hauler Directory: $HAULER_DIR" info "Successfully Uninstalled Hauler" && echo exit 0 @@ -137,16 +141,19 @@ verbose "- Platform: $PLATFORM" verbose "- Architecture: $ARCH" verbose "- Install Directory: ${HAULER_INSTALL_DIR}" +# set hauler directory from argument or environment variable +HAULER_DIR=${HAULER_INSTALL_DIR:-$HOME/.hauler} + # check working directory and/or create it -if [ ! -d "$HOME/.hauler" ]; then - mkdir -p "$HOME/.hauler" || fatal "Failed to Create Directory: $HOME/.hauler" +if [ ! -d "$HAULER_DIR" ]; then + mkdir -p "$HAULER_DIR" || fatal "Failed to Create Directory: $HAULER_DIR" fi # update permissions of working directory -chmod -R 777 "$HOME/.hauler" || fatal "Failed to Update Permissions of Directory: $HOME/.hauler" +chmod -R 777 "$HAULER_DIR" || fatal "Failed to Update Permissions of Directory: $HAULER_DIR" # change to working directory -cd "$HOME/.hauler" || fatal "Failed to Change Directory: $HOME/.hauler" +cd "$HAULER_DIR" || fatal "Failed to Change Directory: $HAULER_DIR" # start hauler artifacts download info "Starting Download..."