Hi John,

> Useful blog post, thanks!

Thanks!

> I've been using lein-oneoff for this. What are the differences between
> lein-exec and lein-oneoff?

Current latest versions of lein-exec (0.2.0) and lein-oneoff (0.2.0)
have some overlap, but let me list few differences AFAIC:

1. lein-oneoff works with Lein 1.x, lein-exec works with Lein 2

2. lein-oneoff can start up REPL, which is rather cool. lein-exec
cannot.

3. lein-oneoff can start up swank, lein-exec doesn't know about swank

4. Let's say we have a file hello.clj with content as follows:

    (println "Hello World!")

    How long does it take for lein-exec and lein-oneoff to run it?
This is what I got:

    tmp shantanu$ time lein oneoff hello.clj
    Hello World!

    real        0m5.935s
    user        0m15.050s
    sys 0m0.795s
    tmp shantanu$ time lein2 exec hello.clj
    Hello World!

    real        0m2.115s
    user        0m6.809s
    sys 0m0.277s

    I think the improvements may be due to Leiningen 2.

5. lein-exec supports piping, not sure about lein-oneoff (I couldn't
figure out a way to.)

6. lein-exec can work both with and without project-context. lein-
oneoff works only without project context. This capability is new in
Leiningen 2.

7. In lein-oneoff you specify all dependencies in the beginning using
#_(defdeps ..). In lein-exec you are free to pull in dependencies at
any point in the code.

8. lein-oneoff doesn't preserve the name of the script in *command-
line-args*; lein-exec does.

Hope that helps.

Shantanu

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to