Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions Godeps/_workspace/src/github.com/mitchellh/go-homedir/LICENSE

This file was deleted.

14 changes: 0 additions & 14 deletions Godeps/_workspace/src/github.com/mitchellh/go-homedir/README.md

This file was deleted.

83 changes: 0 additions & 83 deletions Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions drivers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"os"
"os/exec"
"path"
"path/filepath"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -562,13 +562,13 @@ func (driver *Driver) generateCertForAzure() error {
}

func (driver *Driver) sshKeyPath() string {
return path.Join(driver.storePath, "id_rsa")
return filepath.Join(driver.storePath, "id_rsa")
}

func (driver *Driver) publicSSHKeyPath() string {
return driver.sshKeyPath() + ".pub"
}

func (driver *Driver) azureCertPath() string {
return path.Join(driver.storePath, "azure_cert.pem")
return filepath.Join(driver.storePath, "azure_cert.pem")
}
4 changes: 2 additions & 2 deletions drivers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"time"

"code.google.com/p/goauth2/oauth"
Expand Down Expand Up @@ -323,7 +323,7 @@ func (d *Driver) getClient() *godo.Client {
}

func (d *Driver) sshKeyPath() string {
return path.Join(d.storePath, "id_rsa")
return filepath.Join(d.storePath, "id_rsa")
}

func (d *Driver) publicSSHKeyPath() string {
Expand Down
16 changes: 9 additions & 7 deletions drivers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import (
"fmt"
"os"
"path/filepath"

homedir "github.com/mitchellh/go-homedir"
"runtime"
)

func PublicKeyPath() string {
homeDir, err := homedir.Dir()
if err != nil {
homeDir = ""
func GetHomeDir() string {
if runtime.GOOS == "windows" {
return os.Getenv("USERPROFILE")
}
return filepath.Join(homeDir, ".docker/public-key.json")
return os.Getenv("HOME")
}

func PublicKeyPath() string {
return filepath.Join(GetHomeDir(), ".docker", "public-key.json")
}

func AddPublicKeyToAuthorizedHosts(d Driver, authorizedKeysPath string) error {
Expand Down
10 changes: 5 additions & 5 deletions drivers/virtualbox/virtualbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"net/http"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
"runtime"
"strconv"
Expand Down Expand Up @@ -209,7 +209,7 @@ func (d *Driver) Create() error {
"--port", "0",
"--device", "0",
"--type", "dvddrive",
"--medium", path.Join(d.storePath, "boot2docker.iso")); err != nil {
"--medium", filepath.Join(d.storePath, "boot2docker.iso")); err != nil {
return err
}

Expand Down Expand Up @@ -434,15 +434,15 @@ func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) {
}

func (d *Driver) sshKeyPath() string {
return path.Join(d.storePath, "id_rsa")
return filepath.Join(d.storePath, "id_rsa")
}

func (d *Driver) publicSSHKeyPath() string {
return d.sshKeyPath() + ".pub"
}

func (d *Driver) diskPath() string {
return path.Join(d.storePath, "disk.vmdk")
return filepath.Join(d.storePath, "disk.vmdk")
}

// Get the latest boot2docker release tag name (e.g. "v0.6.0").
Expand Down Expand Up @@ -490,7 +490,7 @@ func downloadISO(dir, file, url string) error {
if err := f.Close(); err != nil {
return err
}
if err := os.Rename(f.Name(), path.Join(dir, file)); err != nil {
if err := os.Rename(f.Name(), filepath.Join(dir, file)); err != nil {
return err
}
return nil
Expand Down
6 changes: 3 additions & 3 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"

log "github.com/Sirupsen/logrus"
Expand Down Expand Up @@ -105,7 +105,7 @@ func (h *Host) GetURL() (string, error) {
}

func (h *Host) LoadConfig() error {
data, err := ioutil.ReadFile(path.Join(h.storePath, "config.json"))
data, err := ioutil.ReadFile(filepath.Join(h.storePath, "config.json"))
if err != nil {
return err
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func (h *Host) SaveConfig() error {
if err != nil {
return err
}
if err := ioutil.WriteFile(path.Join(h.storePath, "config.json"), data, 0600); err != nil {
if err := ioutil.WriteFile(filepath.Join(h.storePath, "config.json"), data, 0600); err != nil {
return err
}
return nil
Expand Down
Loading