Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
43b57777
Commit
43b57777
authored
Feb 28, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #398 from tgerring/assetpath
Check source directory for assets as last resort
parents
7ab13e0f
a39c7367
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
common.go
ethutil/common.go
+11
-2
No files found.
ethutil/common.go
View file @
43b57777
...
...
@@ -15,11 +15,13 @@ import (
func
DefaultAssetPath
()
string
{
var
assetPath
string
pwd
,
_
:=
os
.
Getwd
()
srcdir
:=
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"cmd"
,
"mist"
)
// 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"
,
"cmd"
,
"mist"
)
{
if
pwd
==
srcdir
{
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
}
else
{
switch
runtime
.
GOOS
{
...
...
@@ -35,6 +37,13 @@ func DefaultAssetPath() string {
assetPath
=
"."
}
}
// Check if the assetPath exists. If not, try the source directory
// This happens when binary is run from outside cmd/mist directory
if
_
,
err
:=
os
.
Stat
(
assetPath
);
os
.
IsNotExist
(
err
)
{
assetPath
=
path
.
Join
(
srcdir
,
"assets"
)
}
return
assetPath
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment