Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CombinedCmd and removed EnvCmd #628

Merged
merged 1 commit into from
Jul 24, 2015
Merged

Added CombinedCmd and removed EnvCmd #628

merged 1 commit into from
Jul 24, 2015

Conversation

mhriemers
Copy link
Contributor

I added CombinedCmd for ONBUILD instruction and possible future commands that will be added that will have a similar form. For readability I made it so that it uses a CmdLike object as an argument. Cmd could also be used with an extra argument but it would degrade readability. Removed EnvCmd because it introduced an inconsistency in the API with ADD and COPY. Made Cmd accept multiple arguments because this solves the ADD and ENV inconsistency. This fix won't break the old API because a string with a space in the middle is still acceptable only less readable.

I added CombinedCmd for ONBUILD instruction and possible future commands that will be added that will have a similar form. For readability I made it so that it uses a CmdLike object as an argument. Cmd could also be used with an extra argument but it would degrade readability. Removed ENV because it introduced an inconsistency with ADD and COPY. Made `Cmd` accept multiple arguments because this solves the ADD and ENV issue. This fix won't break the old api because a string with a space in the middle is still acceptable only less readable.
@muuki88 muuki88 added the docker label Jul 24, 2015
* }}}
*/
case class Cmd(cmd: String, arg: String) extends CmdLike {
def makeContent = "%s %s\n" format (cmd, arg)
case class Cmd(cmd: String, args: String*) extends CmdLike {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure about this. Cmd(cmd: String, first: String, rest: String*) would represent the old interface more correctly. However with your suggestion zero-argument commands would be possible.

@jsuereth what about binary compatibility?

@muuki88
Copy link
Contributor

muuki88 commented Jul 24, 2015

I'm merging this at this point as it's about time to release a small RC with some fixes. Would you mind making another pull request if we would break binary compatibility?

thanks a lot for you help :) (and for the nice docs!)

muuki88 added a commit that referenced this pull request Jul 24, 2015
Added CombinedCmd and removed EnvCmd
@muuki88 muuki88 merged commit ee4406c into sbt:master Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants