Support installation to different directoy

Introduce configuration file to set a custom seqs collection
This commit is contained in:
2022-03-07 00:15:27 +01:00
parent 56765a0884
commit b894a756ea
5 changed files with 87 additions and 18 deletions

View File

@@ -36,9 +36,19 @@ _sqnall_completions()
}
installCompletion() {
local SEQBASE="/opt/sequencer/seqs"
# Get script working directory
# (when called from a different directory)
local WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)"
. ${WDIR}/sequencer.cfg &>/dev/null
local SEQBASE="${WDIR}/seqs"
local SEQPREFIX="sqn_"
local SEQSHORT=()
# Check for user selected sequences
[ -e "$SEQUENCER_USER_SEQS" ] && SEQBASE="$SEQUENCER_USER_SEQS"
# Create aliases and command (alias) list for "complete" command"
SEQLIST=($(ls "$SEQBASE/$cur"*.sh))
for i in "${!SEQLIST[@]}"; do