good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 2bd4ad39 authored by Jaynti Kanani's avatar Jaynti Kanani
Browse files

chg: changes for import/export command

parent 8c7cf1d6
No related branches found
No related tags found
No related merge requests found
...@@ -274,7 +274,7 @@ func dumpGenesis(ctx *cli.Context) error { ...@@ -274,7 +274,7 @@ func dumpGenesis(ctx *cli.Context) error {
} }
func importChain(ctx *cli.Context) error { func importChain(ctx *cli.Context) error {
if len(ctx.Args()) < 1 { if len(ctx.Args()) < 2 {
utils.Fatalf("This command requires an argument.") utils.Fatalf("This command requires an argument.")
} }
// Start metrics export if enabled // Start metrics export if enabled
...@@ -308,13 +308,14 @@ func importChain(ctx *cli.Context) error { ...@@ -308,13 +308,14 @@ func importChain(ctx *cli.Context) error {
var importErr error var importErr error
if len(ctx.Args()) == 1 { // ArgsUsage: "<filename> (<filename 2> ... <filename N>) <genesisPath>",
if len(ctx.Args()) == 2 {
if err := utils.ImportChain(chain, ctx.Args().First()); err != nil { if err := utils.ImportChain(chain, ctx.Args().First()); err != nil {
importErr = err importErr = err
log.Error("Import error", "err", err) log.Error("Import error", "err", err)
} }
} else { } else {
for _, arg := range ctx.Args() { for _, arg := range ctx.Args()[:len(ctx.Args())-1] {
if err := utils.ImportChain(chain, arg); err != nil { if err := utils.ImportChain(chain, arg); err != nil {
importErr = err importErr = err
log.Error("Import error", "file", arg, "err", err) log.Error("Import error", "file", arg, "err", err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment