Skip to content

Commit

Permalink
fix broken macro example in cookbook.
Browse files Browse the repository at this point in the history
The `with-cwd` example in the cookbook has the closing ) in the wrong
place and needs to unquote it's argument.
  • Loading branch information
thearthur committed Apr 17, 2020
1 parent 90e40cf commit ab29671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/cookbook.md
Expand Up @@ -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:
Expand Down

0 comments on commit ab29671

Please sign in to comment.