Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm just wondering why not use npm scripts instead of Makefiles? They work in Windows as well and they're easier to understand (at least imo).


As long as they're single commands. Running multiple commands using `&&`, etc. is unfortunately not portable.


What platform does `&&` not work on? It works fine in Windows `cmd`, which is the typical shell to worry about portability with.


cmd's `&&` is the equivalent of bash's `;`. bash's `&&` has no equivalent in cmd.

Edit: Never mind, I'm apparently wrong.


On Windows 7; note the lack of version information from Java:

> rm test.txt && java -version

rm: cannot unlink entry "test.txt": The system cannot find the file specified.


That's not correct. I use npm scripts with `&&` on Windows many times per day. Other features may not be portable, but that one definitely is.



I haven't looked at those yet, sounds interesting though!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: