From fb67ff42f4e06566c99059f3ed9bd626375994fa Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sun, 13 Mar 2022 13:25:37 +0100 Subject: [PATCH] sequencer - add subdir to fallback path Fix standard sourcing --- install.sh | 9 +++------ installCompletion.sh | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 55c8cda..9d52695 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,6 @@ SEQUENCER_DIR= # Get script working directory WDIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)" -echo "WDIR:$WDIR" SEQUENCER_DIR="$1" @@ -15,7 +14,7 @@ SEQUENCER_DIR="$1" if [ -z "$SEQUENCER_DIR" ]; then [ -w "$(dirname "$DEFAULT_DIR")" ] && SEQUENCER_DIR="$DEFAULT_DIR" # Fallback to working directory - [ -z "$SEQUENCER_DIR" ] && $SEQUENCER_DIR="${WDIR}" + [ -z "$SEQUENCER_DIR" ] && $SEQUENCER_DIR="${WDIR}/sequencer" fi # Check if already installed @@ -53,7 +52,7 @@ if [ $? -ne 0 ]; then fi # If available use configuration -. ${SEQUENCER_DIR}/sequencer.cfg &>/dev/null +. ${SEQUENCER_DIR}/sequencer.cfg >/dev/null 2>&1 # Set to default if not configured [ -z "$SEQUENCER_USER_SEQS" ] && SEQUENCER_USER_SEQS="$DEFAULT_USER_SEQS" @@ -65,6 +64,4 @@ if [ "$SEQUENCER_USER_SEQS" != "$SEQUENCER_DIR/seqs" ]; then fi echo " [I] Successfully installed shell sequencer" -echo " Don't forget to set git user variables:" -echo " git config user.name \"Your Name\"" -echo " git config user.email \"Your.Name@example.com\"" +echo " to: $SEQUENCER_DIR" diff --git a/installCompletion.sh b/installCompletion.sh index ab6d52a..0a376b7 100755 --- a/installCompletion.sh +++ b/installCompletion.sh @@ -1,12 +1,12 @@ #!/bin/bash # Get script working directory -WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)" +WDIR="$(cd "$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")" >>/dev/null 2>&1 && pwd)" _sequencerCompletion() { local SEQCOMP_LOC="${WDIR}/sqnall-completion.bash" local SEQCOMP_LOADER="$HOME/.bashrc" - local SEQCOMP_SOURCE="source \"$SEQCOMP_LOC\"" + local SEQCOMP_SOURCE=". \"$SEQCOMP_LOC\"" grep "$SEQCOMP_SOURCE" "$SEQCOMP_LOADER" >>/dev/null 2>&1 if [ $? -eq 0 ]; then