Skip to content

Instantly share code, notes, and snippets.

@dch
Forked from asimjalis/sh-timeout.clj
Created April 15, 2013 07:52
Show Gist options
  • Save dch/5386448 to your computer and use it in GitHub Desktop.
Save dch/5386448 to your computer and use it in GitHub Desktop.
(use '[clojure.contrib.shell-out :only [sh]])
(defn sh-timeout [timeout-in-seconds & args]
(.get
(future-call #(apply sh args))
timeout-in-seconds
(java.util.concurrent.TimeUnit/SECONDS)))
@dch
Copy link
Author

dch commented Apr 15, 2013

exception returned is actually a RuntimeException wrapping a TimeoutException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment