Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I execute multiple lein tasks in one command?

I'm new to leiningen.

When I tried to execute following,

$ lein clean jar

I got

Wrong number of arguments to clean task. 
Expected []
$ 

How can I execute multiple tasks in one command?

like image 876
Jin Kwon Avatar asked Mar 10 '16 10:03

Jin Kwon


2 Answers

Yes, it is possible to execute multiple leiningen tasks in sequence with one command.

Example:

lein do clean, test
like image 197
Hachmaninow Avatar answered Nov 08 '22 18:11

Hachmaninow


You can't do it at the command line directly, but you can with an alias in your project.clj file:

:aliases
{"go" ["do" "clean," "jar"]}

So at the command line you would then be able to:

lein go

(The comma after clean is needed, because lein do expects a comma after each command in order to allow passing arguments to the commands.)

like image 27
Chris Murphy Avatar answered Nov 08 '22 16:11

Chris Murphy