i want make shell script startup project env. i'm using iterm2 zsh , oh-my-zsh installed.
i want to:
- open directory
- activate python virtualenv
- run django manage command
- switch new tab
- change directory
- run gulp command watch frontend changes
all got 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 can expect doesn't work. can point me direction should or possible shell script?
completely possible.
i did pretty same thing you're trying (although rails project) using npm package called ttab.
- install npm.
- install ttab.
- you can run commands in new tab so:
# first switch directory cd front # open new tab in directory , execute ttab -g eval "gulp watch"
note: can execute several commands if needed, gulp watch; rails s
.
- if need run command on original tab on different directory, can create procedure/function in script file that:
# define function before called gotofolder() { cd ~/mydirectory } # start other tabs (...) # change original tab directory gotofolder # run rails or whatever ./bin/rails s
if want take @ how did this, please checkout confereai.sh
script in my mdfr repo.
Comments
Post a Comment