Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

Commit c075112

Browse files
Sven DowideitSven Dowideit
authored andcommitted
we don't use Env vars like this, so tell the user the cmdline option they could use
1 parent 258d32f commit c075112

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cmds.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ import (
2020
// Initialize the boot2docker VM from scratch.
2121
func cmdInit() int {
2222
// TODO(@riobard) break up this command into multiple stages
23+
m, err := vbx.GetMachine(B2D.VM)
24+
if err == nil {
25+
logf("Virtual machine %s already exists", B2D.VM)
26+
return 1
27+
}
2328

2429
if ping(fmt.Sprintf("localhost:%d", B2D.DockerPort)) {
25-
logf("DOCKER_PORT=%d on localhost is occupied. Please choose another one.", B2D.DockerPort)
30+
logf("--dockerport=%d on localhost is occupied. Please choose another one.", B2D.DockerPort)
2631
return 1
2732
}
2833

2934
if ping(fmt.Sprintf("localhost:%d", B2D.SSHPort)) {
30-
logf("SSH_PORT=%d on localhost is occupied. Please choose another one.", B2D.SSHPort)
35+
logf("--sshport=%d on localhost is occupied. Please choose another one.", B2D.SSHPort)
3136
return 1
3237
}
3338

@@ -54,7 +59,7 @@ func cmdInit() int {
5459
//TODO: print a ~/.ssh/config entry for our b2d connection that the user can c&p
5560

5661
logf("Creating VM %s...", B2D.VM)
57-
m, err := vbx.CreateMachine(B2D.VM, "")
62+
m, err = vbx.CreateMachine(B2D.VM, "")
5863
if err != nil {
5964
logf("Failed to create VM %q: %s", B2D.VM, err)
6065
return 1

0 commit comments

Comments
 (0)