Re:When Bash scripts bite
by mbrock on Friday May 12, 2017 @04:38AM
(#14322318)
Error handling in asynchronous JavaScript is quite notorious for being easy to screw up.
[ Parent
| on HN ]
True for async code, but if you use something like ShellJS [1] (which would be an easy way to rewrite a bash script that was getting out of hand), all commands are synchronous, so error handling is just try/catch.
Re:When Bash scripts bite
by moosingin3space on Friday May 12, 2017 @03:48PM
(#14327279)
If only everyone used promises...I can dream, right?
Regardless, I'd actually prefer Haskell's do-notation for both asynchronous commands and shell-scripting tasks. Even though Haskell isn't my favorite language, do-notation is quite nice for this.