|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
"github.com/ethereum/eth-go" |
|
|
|
"github.com/ethereum/eth-go" |
|
|
|
"github.com/ethereum/eth-go/ethutil" |
|
|
|
"github.com/ethereum/eth-go/ethutil" |
|
|
|
"github.com/niemeyer/qml" |
|
|
|
"github.com/niemeyer/qml" |
|
|
|
|
|
|
|
"os" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"runtime" |
|
|
|
"runtime" |
|
|
@ -49,18 +50,25 @@ func (ui *UiLib) AssetPath(p string) string { |
|
|
|
|
|
|
|
|
|
|
|
func AssetPath(p string) string { |
|
|
|
func AssetPath(p string) string { |
|
|
|
var base string |
|
|
|
var base string |
|
|
|
switch runtime.GOOS { |
|
|
|
// If the current working directory is the go-ethereum dir
|
|
|
|
case "darwin": |
|
|
|
// assume a debug build and use the source directory as
|
|
|
|
// Get Binary Directory
|
|
|
|
// asset directory.
|
|
|
|
exedir, _ := osext.ExecutableFolder() |
|
|
|
pwd, _ := os.Getwd() |
|
|
|
base = filepath.Join(exedir, "../Resources") |
|
|
|
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum") { |
|
|
|
base = "/Users/maranhidskes/projects/go/src/github.com/ethereum/go-ethereum" |
|
|
|
base = pwd |
|
|
|
case "linux": |
|
|
|
} else { |
|
|
|
base = "/usr/share/ethereal" |
|
|
|
switch runtime.GOOS { |
|
|
|
case "window": |
|
|
|
case "darwin": |
|
|
|
fallthrough |
|
|
|
// Get Binary Directory
|
|
|
|
default: |
|
|
|
exedir, _ := osext.ExecutableFolder() |
|
|
|
base = "." |
|
|
|
base = filepath.Join(exedir, "../Resources") |
|
|
|
|
|
|
|
case "linux": |
|
|
|
|
|
|
|
base = "/usr/share/ethereal" |
|
|
|
|
|
|
|
case "window": |
|
|
|
|
|
|
|
fallthrough |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
base = "." |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return path.Join(base, p) |
|
|
|
return path.Join(base, p) |
|
|
|