Run system command in shell, raise SystemExit if it returns an error.
(cmd)
| 24 | |
| 25 | # Utility functions |
| 26 | def sh(cmd): |
| 27 | """Run system command in shell, raise SystemExit if it returns an error.""" |
| 28 | print("$", cmd) |
| 29 | stat = os.system(cmd) |
| 30 | #stat = 0 # Uncomment this and comment previous to run in debug mode |
| 31 | if stat: |
| 32 | raise SystemExit("Command %s failed with code: %s" % (cmd, stat)) |
| 33 | |
| 34 | def get_ipdir(): |
| 35 | """Get IPython directory from command line, or assume it's the one above.""" |