diff options
author | Maran <maran.hidskes@gmail.com> | 2014-03-17 17:42:36 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-03-17 17:42:36 +0800 |
commit | 07734c1e1c5a28d1d44de696d83190bc59f239f7 (patch) | |
tree | 5bff7731730511edec88e0a0c72c2312d916abb3 | |
parent | 1c983ed80cc71e7451c7223bae7e30fc41e07b20 (diff) | |
parent | 85e04476845a5a41836824b133d939faf4e1c3fa (diff) | |
download | go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar.gz go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar.bz2 go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar.lz go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar.xz go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.tar.zst go-tangerine-07734c1e1c5a28d1d44de696d83190bc59f239f7.zip |
Merge conflicts
-rw-r--r-- | ui/ui_lib.go | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/ui/ui_lib.go b/ui/ui_lib.go index fb5957cc3..518a21bc5 100644 --- a/ui/ui_lib.go +++ b/ui/ui_lib.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethutil" "github.com/niemeyer/qml" + "os" "path" "path/filepath" "runtime" @@ -49,18 +50,25 @@ func (ui *UiLib) AssetPath(p string) string { func AssetPath(p string) string { var base string - switch runtime.GOOS { - case "darwin": - // Get Binary Directory - exedir, _ := osext.ExecutableFolder() - base = filepath.Join(exedir, "../Resources") - base = "/Users/maranhidskes/projects/go/src/github.com/ethereum/go-ethereum" - case "linux": - base = "/usr/share/ethereal" - case "window": - fallthrough - default: - base = "." + // If the current working directory is the go-ethereum dir + // assume a debug build and use the source directory as + // asset directory. + pwd, _ := os.Getwd() + if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum") { + base = pwd + } else { + switch runtime.GOOS { + case "darwin": + // Get Binary Directory + exedir, _ := osext.ExecutableFolder() + base = filepath.Join(exedir, "../Resources") + case "linux": + base = "/usr/share/ethereal" + case "window": + fallthrough + default: + base = "." + } } return path.Join(base, p) |