more fix
This commit is contained in:
@@ -1,29 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# get base dir regardless of execution location
|
|
||||||
# resolve shell-specifics
|
|
||||||
case "$(echo "$SHELL" | sed -E 's|/usr(/local)?||g')" in
|
|
||||||
"/bin/zsh")
|
|
||||||
RCPATH="$HOME/.zshrc"
|
|
||||||
SOURCE="${BASH_SOURCE[0]:-${(%):-%N}}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
RCPATH="$HOME/.bashrc"
|
|
||||||
if [[ -f "$HOME/.bash_aliases" ]]; then
|
|
||||||
RCPATH="$HOME/.bash_aliases"
|
|
||||||
fi
|
|
||||||
SOURCE="${BASH_SOURCE[0]}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# get base dir regardless of execution location
|
# get base dir regardless of execution location
|
||||||
|
basedir=$1
|
||||||
|
|
||||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
source "$basedir/scripts/functions.sh"
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
||||||
SOURCE="$(readlink "$SOURCE")"
|
. $basedir/functions.sh
|
||||||
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
|
||||||
done
|
|
||||||
. $(dirname $SOURCE)/init.sh
|
|
||||||
PS1="$"
|
|
||||||
|
|
||||||
paperVer=$(cat current-paper)
|
paperVer=$(cat current-paper)
|
||||||
gpgsign="$(git config commit.gpgsign || echo "false")"
|
gpgsign="$(git config commit.gpgsign || echo "false")"
|
||||||
|
|||||||
@@ -102,3 +102,15 @@ function containsElement {
|
|||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bashColor {
|
||||||
|
if [ $2 ]; then
|
||||||
|
echo -e "\e[$1;$2m"
|
||||||
|
else
|
||||||
|
echo -e "\e[$1m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
function bashColorReset {
|
||||||
|
echo -e "\e[m"
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user