I am writing a bat file to auto install npm packages and install compass. The bat is simple as below:
npm install -g bower npm install -g grunt-cli npm install gem update --system --verbose gem install compass --verbose pause
I find that after each command, the bat file auto aborts and won't run next command. How can I make this simple script run continuously and able to re-run many times?
Add a pause statement to a batch file If you're creating a batch file and want the MS-DOS window to remain open, add PAUSE to the end of your batch file. This prompts the user to Press any key. Until the user presses any key, the window remains open instead of closing automatically.
To stop a running npm process, press CTRL + C or close the shell window.
Possibly the npm program is a batch file itself.
Then you need to use call
, as only then the program control returns to the caller.
call npm install -g bower call npm install -g grunt-cli call npm install call gem update --system --verbose call gem install compass --verbose pause
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With