1
我试图克隆下来的git回购的同时在不同的Mac端片,因为它们需要很长的时间来克隆下来。并发执行
我已经尝试了很多的变化之下,但似乎无法让每个单独的克隆,然后在3个不同的终端选项卡下面的命令,在同一时间运行,我如何能更改以下任何想法要做到这一点,而不需要安装诸如ttab之类的外部功能?
cwd=$(pwd)
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' -e 'tell application "Terminal" to do script "cd '$cwd' && git clone [email protected]:me/myrepo1.git && cd myrepo1 && git pull && nvm use && npm install &" in selected tab of the front window' &
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' -e 'tell application "Terminal" to do script "cd '$cwd' && git clone [email protected]:me/myrepo3.git && cd myrepo2 && git pull && nvm use && npm install" in selected tab of the front window' &
git clone [email protected]:me/myrepo3.git && cd myrepo3 && git pull && nvm use && npm install
很好的答案,谢谢! – JL9
没问题:)我很高兴它有帮助。 –