2023-07-22 14:46:26 +02:00
|
|
|
# Work directories
|
|
|
|
WORK="$HOME/Projects/Work"
|
|
|
|
UTIL="$HOME/Projects/Work/utility"
|
|
|
|
PUB="$HOME/Projects/Work/publikator/"
|
2023-12-13 13:11:25 +01:00
|
|
|
AR="$HOME/Projects/Work/arriva_server/"
|
2023-07-28 15:56:52 +02:00
|
|
|
NEG="$HOME/Projects/Work/negocjator/"
|
2023-12-13 13:11:25 +01:00
|
|
|
SZ="$HOME/Projects/Work/szyna/"
|
2023-07-22 14:46:26 +02:00
|
|
|
|
|
|
|
# Workflow
|
2023-11-23 12:29:53 +01:00
|
|
|
alias work="cd $WORK"
|
2023-07-22 14:46:26 +02:00
|
|
|
alias util="cd $UTIL && make"
|
|
|
|
alias pub="cd $PUB"
|
|
|
|
alias neg="cd $NEG"
|
2023-12-13 13:11:25 +01:00
|
|
|
alias sz="cd $SZ"
|
|
|
|
alias ar="cd $AR"
|
2023-11-23 13:34:10 +01:00
|
|
|
|
|
|
|
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}
|
2023-12-13 13:11:25 +01:00
|
|
|
last_part=$(echo $last_part | tr '[:upper:]' '[:lower:]')
|
2023-11-23 13:34:10 +01:00
|
|
|
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}
|
2023-12-13 13:11:25 +01:00
|
|
|
last_part=$(echo $last_part | tr '[:upper:]' '[:lower:]')
|
2023-11-23 13:34:10 +01:00
|
|
|
alias neg$last_part="cd $d && display_makefile_help && activate_venv"
|
|
|
|
fi
|
|
|
|
done
|
2023-12-13 13:11:25 +01:00
|
|
|
|
|
|
|
for d in $SZ/*; do
|
|
|
|
if [ -d "$d" ]; then
|
|
|
|
last_part=$(basename $d | tr "_" " " | awk '{print $NF}')
|
|
|
|
last_part=${last_part:0:2}
|
|
|
|
last_part=$(echo $last_part | tr '[:upper:]' '[:lower:]')
|
|
|
|
alias sz$last_part="cd $d && display_makefile_help && activate_venv"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for d in $AR/*; do
|
|
|
|
if [ -d "$d" ]; then
|
|
|
|
last_part=$(basename $d | tr "_" " " | awk '{print $NF}')
|
|
|
|
last_part=${last_part:0:1}
|
|
|
|
last_part=$(echo $last_part | tr '[:upper:]' '[:lower:]')
|
|
|
|
alias ar$last_part="cd $d && display_makefile_help && activate_venv"
|
|
|
|
fi
|
|
|
|
done
|