From e665d9725c4bb02f4c18d16527367f424cb880fa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Mar 2019 15:55:57 -0700 Subject: Auto-updated to 7.0.0 syntax and removed some shims. --- lib/shell/init.nom | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'lib/shell/init.nom') 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 -- cgit v1.2.3