Skip to content

Instantly share code, notes, and snippets.

@oskosk
Created May 11, 2015 12:46
Show Gist options
  • Save oskosk/8616dd9ccc641ca4baad to your computer and use it in GitHub Desktop.
Save oskosk/8616dd9ccc641ca4baad to your computer and use it in GitHub Desktop.
// $ npm install shelljs
//
require("shelljs/global");
var scripts = [ "./script1.sh", "./script2.sh", "./script3.sh" ];
scripts.forEach(function(s) {
// Este exec es exportado en el scope global por shelljs
// Es sincrónico.
if (exec(s).code !== 0) {
echo('Error: ' + s);
exit(1);
}
});
#!/bin/bash
for i in $(seq 1 10); do echo $i; done
sleep 1
#!/bin/bash
for i in $(seq 10 20); do echo $i; done
sleep 2
#!/bin/bash
for i in $(seq 20 30); do echo $i; done
sleep 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment