2023-07-22 14:46:26 +02:00
|
|
|
function cd
|
|
|
|
{
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
pushd ~ > /dev/null
|
|
|
|
elif [ " $1" = " -" ]; then
|
|
|
|
pushd "$OLDPWD" > /dev/null
|
|
|
|
else
|
2024-02-21 13:06:01 +01:00
|
|
|
pushd "$1" > /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$VIRTUAL_ENV" != "" ]; then
|
|
|
|
local venvpath=$(dirname $VIRTUAL_ENV)
|
|
|
|
case $PWD/ in
|
|
|
|
$venvpath/* ) ;;
|
|
|
|
*) deactivate;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f .venv/bin/activate ]; then
|
|
|
|
source .venv/bin/activate
|
|
|
|
fi
|
|
|
|
|
2024-10-16 16:55:16 +02:00
|
|
|
if [ -f .localrc ]; then
|
|
|
|
source .localrc
|
|
|
|
fi
|
|
|
|
|
2024-02-21 13:06:01 +01:00
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
if [ -f Makefile ]; then
|
|
|
|
make ${@:2}
|
|
|
|
else
|
|
|
|
fi
|
2023-07-22 14:46:26 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function cdd
|
|
|
|
{
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
cd -
|
|
|
|
else
|
|
|
|
cd +$1
|
|
|
|
fi
|
|
|
|
}
|
2024-02-23 14:49:21 +01:00
|
|
|
|
|
|
|
cd $PWD
|