dot/.config/aliasrc/work
2023-11-23 13:34:10 +01:00

38 lines
1.1 KiB
Text
Executable file

# Work directories
WORK="$HOME/Projects/Work"
UTIL="$HOME/Projects/Work/utility"
BPS="$HOME/Projects/Work/BPS"
PUB="$HOME/Projects/Work/publikator/"
AR="$HOME/Projects/Work/arriva_server/server"
KRD="$HOME/Projects/Work/robots/krd_syncer"
NEG="$HOME/Projects/Work/negocjator/"
# Workflow
alias work="cd $WORK"
alias util="cd $UTIL && make"
alias bps="cd $BPS && make"
alias pub="cd $PUB"
alias ar="cd $AR && make"
alias arr="ar"
alias krd="cd $KRD"
alias neg="cd $NEG"
alias activate_venv="[ -f .venv/bin/activate ] && source .venv/bin/activate"
alias display_makefile_help="[ -f Makefile ] && make"
# dynamic aliases
for d in $PUB/*; do
if [ -d "$d" ]; then
last_part=$(basename $d | tr "_" " " | awk '{print $NF}')
last_part=${last_part:0:1}
alias pub$last_part="cd $d && display_makefile_help && activate_venv"
fi
done
for d in $NEG/*; do
if [ -d "$d" ]; then
last_part=$(basename $d | tr "_" " " | awk '{print $NF}')
last_part=${last_part:0:1}
alias neg$last_part="cd $d && display_makefile_help && activate_venv"
fi
done