From ab29671c31bdfaed622463745403762daf1ce450 Mon Sep 17 00:00:00 2001 From: Arthur Ulfeldt Date: Fri, 17 Apr 2020 11:05:49 -0700 Subject: [PATCH] fix broken macro example in cookbook. The `with-cwd` example in the cookbook has the closing ) in the wrong place and needs to unquote it's argument. --- doc/cookbook.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/cookbook.md b/doc/cookbook.md index 8f4070ee..c10d925a 100644 --- a/doc/cookbook.md +++ b/doc/cookbook.md @@ -123,10 +123,10 @@ popd Possible solution in closh with a macro: ```clojure -(defmacro with-cwd [dir & body]) +(defmacro with-cwd [dir & body] `(binding [closh.zero.platform.process/*cwd* - (atom (closh.zero.platform.process/resolve-path dir))]) - (sh ~@body) + (atom (closh.zero.platform.process/resolve-path ~dir))] + (sh ~@body))) ``` Then it can be used as: