Specify the Directory of a Shell Command
Clojure gives us access to Java's shell capabilities through clojure.java.shell
. For instance, if you want to list the contents of your project's directory, you can issue an ls
command:
The default will always be to execute the command in the directory of the containing project. It is likely that you'd like to specify a different directory though. There is a function for that:
Or more concisely, you can specify the directory as part of the sh
function:
Last updated