How can I execute multiple lein tasks in one command?
Asked Answered
F

2

6

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?

Fideicommissary answered 10/3, 2016 at 10:54 Comment(0)
H
17

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

Example:

lein do clean, test
Herndon answered 12/7, 2016 at 11:9 Comment(0)
C
6

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.)

Cybele answered 10/3, 2016 at 11:18 Comment(1)
:aliases {"go" ["do" "clean," "jar"]} I had to add the comma for a project where I needed to wait on the build. Just a heads upHettie

© 2022 - 2024 — McMap. All rights reserved.