Files
shell_sequencer/installCompletion.sh
Martin Winkler b894a756ea Support installation to different directoy
Introduce configuration file to set a custom seqs collection
2022-03-07 00:15:27 +01:00

22 lines
604 B
Bash
Executable File

#!/bin/bash
# Get script working directory
WDIR="$(cd "$(dirname "${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\""
grep "$SEQCOMP_SOURCE" "$SEQCOMP_LOADER" >>/dev/null 2>&1
if [ $? -eq 0 ]; then
echo " [I] Completion already installed ($SEQCOMP_LOADER)"
else
echo "$SEQCOMP_SOURCE" >>"$SEQCOMP_LOADER"
[ $? -eq 0 ] && echo " [I] Sequence bash-completion installed"
fi
source "$SEQCOMP_LOC"
}
_sequencerCompletion