diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-07 03:39:29 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-07 03:39:29 +0800 |
commit | 698e98d9814605bfea98ba3ad2fe7fda073cb2b1 (patch) | |
tree | 729aa720f3b18b9eb901111d1d58c355bc9b744c /cmd/utils/customflags.go | |
parent | a3b8169938953a10ab57282853768c72bebaf0b4 (diff) | |
parent | 803096ca0f262be7d03081482777c3e293f5f7ac (diff) | |
download | dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar.gz dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar.bz2 dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar.lz dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar.xz dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.tar.zst dexon-698e98d9814605bfea98ba3ad2fe7fda073cb2b1.zip |
Merge pull request #1600 from ethereum/fix-tests-windows
Fix tests on windows
Diffstat (limited to 'cmd/utils/customflags.go')
-rw-r--r-- | cmd/utils/customflags.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index e7efed4e3..4450065c1 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -21,7 +21,7 @@ import ( "fmt" "os" "os/user" - "path/filepath" + "path" "strings" "github.com/codegangsta/cli" @@ -138,11 +138,8 @@ func (self *DirectoryFlag) Set(value string) { func expandPath(p string) string { if strings.HasPrefix(p, "~/") || strings.HasPrefix(p, "~\\") { if user, err := user.Current(); err == nil { - if err == nil { - p = strings.Replace(p, "~", user.HomeDir, 1) - } + p = user.HomeDir + p[1:] } } - - return filepath.Clean(os.ExpandEnv(p)) + return path.Clean(os.ExpandEnv(p)) } |