diff options
author | Bas van Kervel <bas@ethdev.com> | 2016-04-07 19:48:24 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2016-04-11 19:32:26 +0800 |
commit | 3c5329599c6a07176fb80848f8592c5f90944a31 (patch) | |
tree | 2346e3f01238a91e5d605bffeef29e09b180e016 /cmd/geth/main.go | |
parent | 7e02105672cda92889a78db864a5701d78f45eb2 (diff) | |
download | go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar.gz go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar.bz2 go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar.lz go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar.xz go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.tar.zst go-tangerine-3c5329599c6a07176fb80848f8592c5f90944a31.zip |
cmd/geth: add JS preload parameter
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 645743c13..c0a7ba318 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -331,6 +331,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.IPCApiFlag, utils.IPCPathFlag, utils.ExecFlag, + utils.PreLoadJSFlag, utils.WhisperEnabledFlag, utils.DevModeFlag, utils.TestNetFlag, @@ -427,6 +428,13 @@ func attach(ctx *cli.Context) { true, ) + // preload user defined JS files into the console + err = repl.preloadJSFiles(ctx) + if err != nil { + utils.Fatalf("unable to preload JS file %v", err) + } + + // in case the exec flag holds a JS statement execute it and return if ctx.GlobalString(utils.ExecFlag.Name) != "" { repl.batch(ctx.GlobalString(utils.ExecFlag.Name)) } else { @@ -477,6 +485,13 @@ func console(ctx *cli.Context) { ctx.GlobalString(utils.RPCCORSDomainFlag.Name), client, true) + // preload user defined JS files into the console + err = repl.preloadJSFiles(ctx) + if err != nil { + utils.Fatalf("unable to preload JS file %v", err) + } + + // in case the exec flag holds a JS statement execute it and return if script := ctx.GlobalString(utils.ExecFlag.Name); script != "" { repl.batch(script) } else { |