In my VM, my projects are at /var/www/vhosts/projectname/httpdocs/.
When I boot the machine, I start at /home/vagrant/.
I created a script that instantly takes me to the project I want. The problem is, the script uses exec and creates a new session every time I use it.
This is my code:
#!/usr/bin/env zsh
if [ -z "$1" ]; then
echo "No project specified"
exit 1
fi
cd /var/www/vhosts/"$1"/httpdocs/ || exit
echo "---------------------"
echo "Project: $1"
echo " https://$1.vm/"
echo " https://$1.vm/typo3"
echo "---------------------"
exec zsh
Is there another way to set my current path without creating a new session?
Thanks