As I work on different projects at the same time, I want to be able to switch quickly between them. So if I need to work on Project-x I just run in the terminal:
projectx
VS Code is opened at the right project, the web server starts and opens a browser on the correct URL.
This is easily done by adding an alias projectx
to your .bashrc
or .zshrc
with the following contents:
alias projectx="cd /Users/tom/projects/project-x && code . && npm run dev"
Bonus:
How to get the right path? Run pwd | pbcopy
in the root dir of your project.
Top comments (0)