aboutsummaryrefslogtreecommitdiffstats
path: root/common/path.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-09-29 20:24:37 +0800
committerGitHub <noreply@github.com>2016-09-29 20:24:37 +0800
commit44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308 (patch)
treeaaab07e78f7b9341f0fcfbd9348fe96273bd6a0d /common/path.go
parent4e8cec05abb567457e80185cb9fcf7ec2cc90596 (diff)
parentb42a5b118f1aa7ac1235547c8594146978941401 (diff)
downloaddexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.gz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.bz2
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.lz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.xz
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.tar.zst
dexon-44bc2e80ddf82ea2a37c25e7beb0ca06b46b7308.zip
Merge pull request #2914 from fjl/node-coinhabit
cmd/utils, node: make datadir reusable for bzzd
Diffstat (limited to 'common/path.go')
-rw-r--r--common/path.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/common/path.go b/common/path.go
index cbcd13c4f..bd8da86e7 100644
--- a/common/path.go
+++ b/common/path.go
@@ -19,10 +19,8 @@ package common
import (
"fmt"
"os"
- "os/user"
"path/filepath"
"runtime"
- "strings"
)
// MakeName creates a node name that follows the ethereum convention
@@ -32,21 +30,6 @@ func MakeName(name, version string) string {
return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
}
-func ExpandHomePath(p string) (path string) {
- path = p
- sep := string(os.PathSeparator)
-
- // Check in case of paths like "/something/~/something/"
- if len(p) > 1 && p[:1+len(sep)] == "~"+sep {
- usr, _ := user.Current()
- dir := usr.HomeDir
-
- path = strings.Replace(p, "~", dir, 1)
- }
-
- return
-}
-
func FileExist(filePath string) bool {
_, err := os.Stat(filePath)
if err != nil && os.IsNotExist(err) {
@@ -62,13 +45,3 @@ func AbsolutePath(Datadir string, filename string) string {
}
return filepath.Join(Datadir, filename)
}
-
-func HomeDir() string {
- if home := os.Getenv("HOME"); home != "" {
- return home
- }
- if usr, err := user.Current(); err == nil {
- return usr.HomeDir
- }
- return ""
-}