Created
November 5, 2020 03:31
-
-
Save way2ex/bd774c5dc66192527439366b4b8f2f66 to your computer and use it in GitHub Desktop.
Run yarn command for multiple workspaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 调用方式 | |
# sh batch.sh admin,audit,video add package -D | |
echo $@ | |
# 拆分参数 | |
allParams=($@) | |
command=${allParams[@]:1} | |
workspacesString=$1 | |
echo $command | |
oldIFS=$IFS | |
IFS=, | |
workspacesList=($workspacesString) | |
IFS=$oldIFS | |
for workspace in ${workspacesList[@]}; | |
do | |
echo current $workspace | |
yarn workspace $workspace ${command} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment