From 09841b1c9b2553a4572590128580df37c8fa83ad Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 4 Jan 2015 14:20:16 +0100 Subject: Cleaned up some of that util --- ethutil/path.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ethutil') 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) +} -- cgit v1.2.3