Skip to content

Commit

Permalink
Locate VBoxManage and complain if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
riobard committed Feb 23, 2014
1 parent 081aa24 commit 47a5e44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion boot2docker/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func cmdSSH() int {
logf("%s is not registered.", B2D.VM)
return 1
case vmRunning:
// TODO What SSH client is used on Windows?
if err := cmd(B2D.SSH,
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
Expand Down Expand Up @@ -234,7 +235,7 @@ func cmdStatus() int {
// Initialize the boot2docker VM from scratch.
func cmdInit() int {
if state := status(B2D.VM); state != vmUnregistered {
logf("%s already exists.\n")
logf("%q already exists.", B2D.VM)
return 1
}

Expand Down
6 changes: 6 additions & 0 deletions boot2docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strconv"
)
Expand Down Expand Up @@ -122,6 +123,11 @@ func run() int {
return 1
}

if _, err := exec.LookPath(B2D.VBM); err != nil {
logf("failed to locate VirtualBox management utility %q", B2D.VBM)
return 2
}

switch flag.Arg(0) {
case "download":
return cmdDownload()
Expand Down
4 changes: 2 additions & 2 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Configuration
- [X] modify standard values with enviroment variables
- [ ] modify standard values with a config file `~/profiles`
- [ ] check if all required software exists e.g. virtualbox,..
- [X] check if all required software exists e.g. virtualbox,..

### Commands
- [X] init Create a new boot2docker VM.
Expand All @@ -21,4 +21,4 @@
### Build
- [X] go get suport
- [X] build with Dockerfile
- [ ] Testcases
- [ ] Testcases

0 comments on commit 47a5e44

Please sign in to comment.