Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute sequentially in npm scripts #53

Closed
phloe opened this issue Feb 20, 2018 · 5 comments
Closed

Unable to execute sequentially in npm scripts #53

phloe opened this issue Feb 20, 2018 · 5 comments

Comments

@phloe
Copy link

phloe commented Feb 20, 2018

First off - really nice tool :)

Second - I'm not sure this is a svgr specific issue - or a more general issue regarding transpiled async/await and npm scripts - but...

I'm having trouble executing 2 commands sequentially in an npm script - like so (building a directory of components and making an index file):

  "scripts": {
    "build:icons": "svgr -d ./icons ./images/icons; create-index ./icons",

... when running npm run build:icons the second command starts executing before svgr is done (before it has even created the output dir) - which of course throws an error.

Running the 2 commands directly in bash works beautifully.

(I have also tried using run-s from npm-run-all - makes no difference)

Any ideas?

@gregberge
Copy link
Owner

Try svgr -d ./icons ./images/icons && create-index ./icons

@phloe
Copy link
Author

phloe commented Feb 20, 2018

; and && is basically the same thing - no difference in this situation :)

@gregberge
Copy link
Owner

@rasmusfl0e I experienced that ; does not wait sometimes. But svgr should wait the end of the process before ending, so it is weird.

@phloe
Copy link
Author

phloe commented Feb 20, 2018

really weird... I will continue examining npm script and async/await

@phloe
Copy link
Author

phloe commented Feb 20, 2018

Found a major error on my part - doh. Problem solved.

Thanks for making a great tool :)

@phloe phloe closed this as completed Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants