Skip to content

How to nest jar (or e.g. PublishModule.publishLocal) commands? #3506

Answered by lefou
jk-1 asked this question in Q&A
Discussion options

You must be logged in to vote

That's because you're not calling the apply-methods of the commands. Without, the commands in both lines won't evaluate. Instead, you return the super-version as-is. Since T.command accepts a Task as parameter and super.publishLocal(..) is a task, the compiler will not notice too.

Instead, your example should to look like this:

override def publishLocal(localIvyRepo: String): Command[Unit] = T.command {
  T.traverse(moduleDeps)(_.publishLocal(localIvyRepo))()
  super.publishLocal(localIvyRepo)()
}

Notice the extra parenthesis (()) in both lines.

 override def publishLocal(localIvyRepo: String): Command[Unit] = T.command {
-   T.traverse(moduleDeps)(_.publishLocal(localIvyRepo))
+   T.trav…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jk-1
Comment options

@lefou
Comment options

Answer selected by jk-1
@lefou
Comment options

@jk-1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants