partially fix scripts
This commit is contained in:
@@ -14,25 +14,15 @@ gitcmd="git -c commit.gpgsign=false"
|
||||
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
|
||||
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ "$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
|
||||
SOURCE=$([[ "$SOURCE" = /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}")
|
||||
basedir=$(dirname "$SOURCE")
|
||||
|
||||
function basedir {
|
||||
cd "$basedir"
|
||||
}
|
||||
@@ -41,6 +31,10 @@ function paperdir {
|
||||
cd "$basedir/Paper"
|
||||
}
|
||||
|
||||
gitcmd() {
|
||||
$gitcmd "$@"
|
||||
}
|
||||
|
||||
# COLOUR functions
|
||||
color() {
|
||||
if [ $2 ]; then
|
||||
|
||||
Reference in New Issue
Block a user