|
5 | 5 | "fmt" |
6 | 6 | "net" |
7 | 7 | "os" |
8 | | - "os/exec" |
9 | 8 | "path/filepath" |
10 | 9 | "regexp" |
11 | 10 | "runtime" |
@@ -62,36 +61,6 @@ func cfgFilename(dir string) string { |
62 | 61 | return filename |
63 | 62 | } |
64 | 63 |
|
65 | | -func defaultIsoPath(dir string) string { |
66 | | - var err error |
67 | | - |
68 | | - iso := filepath.Join(dir, "boot2docker.iso") |
69 | | - |
70 | | - exe := os.Args[0] |
71 | | - if filepath.Base(exe) == exe { |
72 | | - // this logic borrowed from reexec/reexec.go in Docker itself :) |
73 | | - if lp, err := exec.LookPath(exe); err == nil { |
74 | | - exe = lp |
75 | | - } |
76 | | - } |
77 | | - |
78 | | - if exe, err = filepath.Abs(exe); err != nil { |
79 | | - return iso |
80 | | - } |
81 | | - |
82 | | - if exe, err = filepath.EvalSymlinks(exe); err != nil { |
83 | | - return iso |
84 | | - } |
85 | | - |
86 | | - // if there's a "boot2docker.iso" next to our boot2docker-cli executable, let's prefer that one by default |
87 | | - exeIso := filepath.Join(filepath.Dir(exe), "boot2docker.iso") |
88 | | - if _, err = os.Stat(exeIso); err == nil { |
89 | | - return exeIso |
90 | | - } |
91 | | - |
92 | | - return iso |
93 | | -} |
94 | | - |
95 | 64 | // Write configuration set by the combination of profile and flags |
96 | 65 | // Should result in a format that can be piped into a profile file |
97 | 66 | func printConfig() string { |
@@ -123,7 +92,7 @@ func config() (*flag.FlagSet, error) { |
123 | 92 | //flags.StringVarP(&B2D.Dir, "dir", "d", dir, "boot2docker config directory.") |
124 | 93 | B2D.Dir = dir |
125 | 94 | flags.StringVar(&B2D.ISOURL, "iso-url", "https://api.github.com/repos/boot2docker/boot2docker/releases", "source URL to provision the boot2docker ISO image.") |
126 | | - flags.StringVar(&B2D.ISO, "iso", defaultIsoPath(dir), "path to boot2docker ISO image.") |
| 95 | + flags.StringVar(&B2D.ISO, "iso", filepath.Join(dir, "boot2docker.iso"), "path to boot2docker ISO image.") |
127 | 96 |
|
128 | 97 | // Sven disabled this, as it is broken - if I user with a fresh computer downloads |
129 | 98 | // just the boot2docker-cli, and then runs `boot2docker --init ip`, we create a vm |
|
0 commit comments