简体   繁体   中英

package.json run multiple commands in sequence with same configuration

I need to run these two commands before each deplay:

  1. ng build --prod --configuration=qa.europe-west1
  2. ng run gw-web-app:server --configuration=qa.europe-west1

I want to write one commands that perform those tow commands in sequence but to also have an option to change the configuration for both of the commands. So if I change the configuration in that commands it will change to each of the commands that are performed.

Something like: npm run run-both-commands --configuration=qa.some-configuration

Is there a way to write a commands in the package.json that will allow to do it?

You may try to create a batch file like below:

echo Enter Configuration
set /p configString="Enter Commit label : "
ng build --prod  --configuration=%configString%
ng run gw-web-app:server --configuration=%configString%

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM