aboutsummaryrefslogtreecommitdiff
path: root/lib/os.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-01-08 16:34:41 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-01-08 16:34:41 -0800
commitfc1655e028a93290f5d6a6e99cec56fa9dbaf0bb (patch)
treeaeb3916f077ef251776fa64388b32a3c693759c1 /lib/os.nom
parentd62631fb5095a8d422a7bd3ca16d510f4e0a503c (diff)
Made separate versions of (sh> ...) and (=sh ...) for versions that
care or don't care about the output.
Diffstat (limited to 'lib/os.nom')
-rw-r--r--lib/os.nom6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/os.nom b/lib/os.nom
index 2e4cd86..3445e8d 100644
--- a/lib/os.nom
+++ b/lib/os.nom
@@ -17,7 +17,7 @@ externally (nomsu files for $path) means:
if $files:
return $files
-externally (sh> $cmd) means:
+externally (=sh $cmd) means:
lua> ("
local result = io.popen(\$cmd)
local contents = result:read("*a")
@@ -25,10 +25,12 @@ externally (sh> $cmd) means:
return contents
")
+external $(sh> $) = $os.execute
+
test:
read file "lib/os.nom"
-externally (read file $filename) means (=lua "Files.read(\$filename)")
+externally (read file $filename) means (=lua "Files.read(\$filename, true)")
externally [
write to file $filename $text, to file $filename write $text
write $text to file $filename