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
沒問題:)我很高興它有幫助。 –