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
223432fa
Commit
223432fa
authored
Jul 15, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around crash issues when building OSX binary
parent
c0ae5c58
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
flags.go
ethereal/flags.go
+29
-2
cmd.go
utils/cmd.go
+1
-0
No files found.
ethereal/flags.go
View file @
223432fa
package
main
import
(
"bitbucket.org/kardianos/osext"
"flag"
"fmt"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"os"
"os/user"
"path"
"path/filepath"
"runtime"
)
var
Identifier
string
...
...
@@ -34,6 +36,31 @@ var LogLevel int
// flags specific to gui client
var
AssetPath
string
//TODO: If we re-use the one defined in cmd.go the binary osx image crashes. If somebody finds out why we can dry this up.
func
defaultAssetPath
()
string
{
var
assetPath
string
// 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"
,
"ethereal"
)
{
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
}
else
{
switch
runtime
.
GOOS
{
case
"darwin"
:
// Get Binary Directory
exedir
,
_
:=
osext
.
ExecutableFolder
()
assetPath
=
filepath
.
Join
(
exedir
,
"../Resources"
)
case
"linux"
:
assetPath
=
"/usr/share/ethereal"
case
"windows"
:
assetPath
=
"./assets"
default
:
assetPath
=
"."
}
}
return
assetPath
}
func
defaultDataDir
()
string
{
usr
,
_
:=
user
.
Current
()
return
path
.
Join
(
usr
.
HomeDir
,
".ethereal"
)
...
...
@@ -66,7 +93,7 @@ func Init() {
flag
.
StringVar
(
&
DebugFile
,
"debug"
,
""
,
"debug file (no debugging if not set)"
)
flag
.
IntVar
(
&
LogLevel
,
"loglevel"
,
int
(
ethlog
.
InfoLevel
),
"loglevel: 0-5: silent,error,warn,info,debug,debug detail)"
)
flag
.
StringVar
(
&
AssetPath
,
"asset_path"
,
utils
.
D
efaultAssetPath
(),
"absolute path to GUI assets directory"
)
flag
.
StringVar
(
&
AssetPath
,
"asset_path"
,
d
efaultAssetPath
(),
"absolute path to GUI assets directory"
)
flag
.
Parse
()
}
utils/cmd.go
View file @
223432fa
...
...
@@ -191,6 +191,7 @@ func DefaultAssetPath() string {
}
return
assetPath
}
func
KeyTasks
(
keyManager
*
ethcrypto
.
KeyManager
,
KeyRing
string
,
GenAddr
bool
,
SecretFile
string
,
ExportDir
string
,
NonInteractive
bool
)
{
ethcrypto
.
InitWords
(
DefaultAssetPath
())
// Init mnemonic word list
...
...
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