Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
139
rated 0 times [  145] [ 6]  / answers: 1 / hits: 175616  / 8 Years ago, fri, august 26, 2016, 12:00:00

Let's say I have



scripts: {
pre-build: echo Welcome && exit 1,
build_logic: start cmd.exe @cmd /k yo esri-appbuilder-js:widget && exit 1,
post_build: start C:\WebAppBuilderForArcGIS\startupShortcut,
exit : start cmd.exe @cmd /k echo goodbye && exit 1
},


What NPM command can I run to let all of these scripts launch sequentially. When I use pre/post fixing they launch sequentially but they don't wait for the parent script to finish before executing. I am assuming the only solution is like: How do I get Gulp tasks to fire sequentially when firing shell commands in an async.series helper function? ? I know this can be done with Gulp but I would like to stick with NPM for now to explore its capabilities. Thanks for any help!


More From » node.js

 Answers
8

Invoke these scripts via npm run and chain them with double ampersand &&:



npm run pre-build && npm run build_logic && npm run post_build && npm run exit


Explanation:




  • Use && (double ampersand) for sequential execution.

  • Use & (single ampersand) for parallel execution.


[#60906] Wednesday, August 24, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aleighabayleef

Total Points: 511
Total Questions: 99
Total Answers: 99

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
;