diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
| commit | e665d9725c4bb02f4c18d16527367f424cb880fa (patch) | |
| tree | aed161ee6b338c2bad2312591f746459414ccafa /lib/shell/init.nom | |
| parent | 606fd090002f3d545cbd58440e96624907846f45 (diff) | |
Auto-updated to 7.0.0 syntax and removed some shims.
Diffstat (limited to 'lib/shell/init.nom')
| -rw-r--r-- | lib/shell/init.nom | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/shell/init.nom b/lib/shell/init.nom index ee6301d..13dc675 100644 --- a/lib/shell/init.nom +++ b/lib/shell/init.nom @@ -1,7 +1,8 @@ -#!/usr/bin/env nomsu -V6 -# - This file defines some actions for running shell commands. +#!/usr/bin/env nomsu -V7.0.0 +### + This file defines some actions for running shell commands. + external: (at $callsite =sh $cmd) means: $f = ($io.popen $cmd) @@ -9,19 +10,26 @@ external: [$ok, $return_type, $return] = ($f, close) unless $ok: if ($return_type == "exit"): - at $callsite fail "Command failure: Command `\$cmd` failed with exit code \$return" + at $callsite fail + "Command failure: Command `\($cmd)` failed with exit code \$return" ..else: - at $callsite fail "Command failure: Command `\$cmd` was terminated by signal \$return" + at $callsite fail + "Command failure: Command `\($cmd)` was terminated by signal \$return" return $contents - + (at $callsite sh> $cmd) means: [$ok, $return_type, $return] = ($os.execute $cmd) unless $ok: if ($return_type == "exit"): - at $callsite fail "Command failure: Command `\$cmd` failed with exit code \$return" + at $callsite fail + "Command failure: Command `\($cmd)` failed with exit code \$return" ..else: - at $callsite fail "Command failure: Command `\$cmd` was terminated by signal \$return" - - # Attach callsite information for better error reporting - (=sh $cmd) compiles to (\(at ("Text" tree with "\($cmd.source)") =sh $cmd) as lua) - (sh> $cmd) compiles to (\(at ("Text" tree with "\($cmd.source)") sh> $cmd) as lua) + at $callsite fail + "Command failure: Command `\($cmd)` was terminated by signal \$return" + + ### Attach callsite information for better error reporting + (=sh $cmd) compiles to + ("Action" tree with "at" ("Text" tree with "\($cmd.source)") "=" "sh" $cmd) as lua + + (sh> $cmd) compiles to + ("Action" tree with "at" ("Text" tree with "\($cmd.source)") "sh" ">" $cmd) as lua
\ No newline at end of file |
