Skip to content

Commit

Permalink
enhancing output and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Jun 4, 2016
1 parent 9646663 commit 2c264b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// VERSION is the app version
const VERSION = "0.3.3"
const VERSION = "0.3.4"

func main() {
app := cli.NewApp()
Expand Down Expand Up @@ -52,6 +52,7 @@ func main() {
},
},
}
jww.INFO.Println("Docker Companion v" + VERSION)

app.Run(os.Args)
}
6 changes: 6 additions & 0 deletions squash.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func squashImage(c *cli.Context) error {
jww.INFO.Println("Squashing " + sourceImage + " in " + outputImage)

err = Squash(client, sourceImage, outputImage)
if err == nil {
jww.INFO.Println("Done")
}
return err
}

Expand All @@ -74,6 +77,9 @@ func Squash(client *docker.Client, image string, toImage string) error {
Cmd: []string{"true"},
},
})
if err != nil {
jww.FATAL.Fatalln("Couldn't create container, sorry", err)
}
defer func(*docker.Container) {
client.RemoveContainer(docker.RemoveContainerOptions{
ID: container.ID,
Expand Down
6 changes: 6 additions & 0 deletions unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func unpackImage(c *cli.Context) error {

jww.INFO.Println("Unpacking " + sourceImage + " in " + output)
err = Unpack(client, sourceImage, output)
if err == nil {
jww.INFO.Println("Done")
}
return err
}

Expand Down Expand Up @@ -82,6 +85,9 @@ func Unpack(client *docker.Client, image string, dirname string) error {
Cmd: []string{"true"},
},
})
if err != nil {
jww.FATAL.Fatalln("Couldn't export container, sorry", err)
}
defer func(*docker.Container) {
client.RemoveContainer(docker.RemoveContainerOptions{
ID: container.ID,
Expand Down

0 comments on commit 2c264b9

Please sign in to comment.