diff --git a/README.md b/README.md index 778a05c..e9ef255 100755 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Feel free to try it out :) The following script install the latest version of the library ```shell -curl -sL https://raw.githubusercontent.com/LamaAni/zbash_config/master/install | $(which sudo || echo "") bash -s $ZBASH_CONFIG_VERSION && zbash_config install +curl -sL https://raw.githubusercontent.com/LamaAni/zbash_config/master/install | bash -s $ZBASH_CONFIG_VERSION && $HOME/.local/bin/zbash_config install ``` # Requires: diff --git a/install b/install index d110ff7..746303b 100755 --- a/install +++ b/install @@ -23,10 +23,10 @@ USAGE: [version] INPUTS: version The version to use. Defautls to latest. ARGS: - --location Install into a specific location. + --location The filepath where to install. " -INSTALL_LOCATION="/usr/local/bin/zbash_config" +INSTALL_LOCATION="$HOME/.local/bin/zbash_config" while [ "$#" -gt 0 ]; do case $1 in @@ -63,18 +63,6 @@ TEMP_DOWNLOAD_PATH="$(mktemp)" REPO_SUBPATH="LamaAni/zbash_config" function install_lib() { - log:sep "Check install context" - log "Checking required premissions" - if [ "$(whoami)" != "root" ]; then - log "checking if sudo is available..." - type sudo >/dev/null 2>&1 - if [ $? -ne 0 ]; then - warn 2 "Sudo not found. Attempting to install with user $(whoami)" - else - assert 2 "Sudo found, please rerun as root" || return $? - fi - fi - log:sep "Prepare temp files" URL_BRANCH="$VERSION" @@ -92,7 +80,10 @@ function install_lib() { echo "$get_script" | bash -s "$VERSION" >|"$TEMP_DOWNLOAD_PATH" assert $? "Failed to download zbash_config compiled script" || return $? - log:sep "Installing zbash_config as $(whoami)" + log:sep "Installing zbash_config as $(whoami) @ $INSTALL_LOCATION" + + mkdir -p "$(dirname "$INSTALL_LOCATION")" + assert $? "Failed to validate install location @ $INSTALL_LOCATION" if [ -f "$INSTALL_LOCATION" ]; then rm -rf "$INSTALL_LOCATION" @@ -107,6 +98,7 @@ function cleanup() { local code=$? rm -rf "$TEMP_DOWNLOAD_PATH" assert "$@" || return $? + return $code } install_lib diff --git a/src/scripts/git.sh b/src/scripts/git.sh index 6dda644..8576c1e 100644 --- a/src/scripts/git.sh +++ b/src/scripts/git.sh @@ -42,6 +42,6 @@ Usage: git_acp my complicated \"message text\"" ;; esac local msg="$(echo "$@")" - : "${msg:="Auto commit @ $(date -u +"%Y-%m-%dT%H:%M:%SZ")"}" + : "${msg:="updated"}" git add . && git commit -m "$msg" --allow-empty && git push -u origin HEAD }