From 6c8da9fe5ce4567d2b7e3d7ab8006c2b9ec80968 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Tue, 25 Dec 2018 15:39:24 -0500 Subject: [PATCH] Install cook tool when installing janet. --- Makefile | 2 ++ src/core/core.janet | 2 +- tools/cook.janet | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d50ddc9e..39ee718e 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,8 @@ install: $(JANET_TARGET) cp $(JANET_HEADERS) $(INCLUDEDIR) mkdir -p $(LIBDIR) cp $(JANET_LIBRARY) $(LIBDIR)/libjanet.so + mkdir -p $(JANET_PATH) + cp tools/cook.janet $(JANET_PATH) cp janet.1 /usr/local/share/man/man1/ mandb $(LDCONFIG) diff --git a/src/core/core.janet b/src/core/core.janet index 108ed934..f0922967 100644 --- a/src/core/core.janet +++ b/src/core/core.janet @@ -236,7 +236,7 @@ (defmacro try "Try something and catch errors. Body is any expression, and catch should be a form with the first element a tuple. This tuple - should contain a binding for errors and an optional binding for + should contain a binding for errors and an optional binding for the fiber wrapping the body. Returns the result of body if no error, or the result of catch if an error." [body catch] diff --git a/tools/cook.janet b/tools/cook.janet index b2151d0e..2468c386 100644 --- a/tools/cook.janet +++ b/tools/cook.janet @@ -9,14 +9,14 @@ [& args] (print ;args) (def res (os/shell (string ;args))) - (unless (zero? res) + (unless (zero? res) (print "Error executing command: " ;args) (os/exit res))) (defn- mkdir "Make a directory. Not safe for user code." [path] - (if is-win + (if is-win (shell "mkdir " path) (shell "mkdir -p " path)))