I want make a shell script to startup my project env. I'm using ITerm2 with zsh and oh-my-zsh installed.
I want to:
All I got is this:
#!/bin/zsh
cd ~/Projects/python/project_name
source ~/virtualenvs/project_name/bin/activate
python ./backend/manage.py runserver
tab
cd front
gulp watch
And as you can expect this doesn't work. Can you point me direction where I should look or is this even possible to do with just shell script?
Completely possible.
I did pretty much the same thing you're trying (although it is a Rails project) using an NPM package called ttab.
# First switch to directory
cd front
# Open new tab in that directory and execute
ttab -G eval "gulp watch"
Note: You can execute several commands if needed, like gulp watch; rails s
gulp watch; rails s
.
# Define the function before it is called
gotofolder()
{
cd ~/mydirectory
}
# start the other tabs (...)
# change the original tab directory
gotofolder
# Run Rails or whatever
./bin/rails s
If you want to take a look at how I did this, please checkout the confereai.sh
script in my MDFR repo .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.