aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/path.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
committerobscuren <geffobscura@gmail.com>2015-01-04 21:20:16 +0800
commit09841b1c9b2553a4572590128580df37c8fa83ad (patch)
tree42a846801bde7d8f7edc5ec07ccbba7806261128 /ethutil/path.go
parentbd0c267cbe9db805b5a272d29ef8860c62ddafe5 (diff)
downloaddexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar.gz
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar.bz2
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar.lz
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar.xz
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.tar.zst
dexon-09841b1c9b2553a4572590128580df37c8fa83ad.zip
Cleaned up some of that util
Diffstat (limited to 'ethutil/path.go')
-rw-r--r--ethutil/path.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/ethutil/path.go b/ethutil/path.go
index cfbc38950..f64e3849e 100644
--- a/ethutil/path.go
+++ b/ethutil/path.go
@@ -4,6 +4,7 @@ import (
"io/ioutil"
"os"
"os/user"
+ "path"
"strings"
)
@@ -58,3 +59,10 @@ func WriteFile(filePath string, content []byte) error {
return nil
}
+
+func AbsolutePath(Datadir string, filename string) string {
+ if path.IsAbs(filename) {
+ return filename
+ }
+ return path.Join(Datadir, filename)
+}