Return error form Repo.Exists

This commit is contained in:
Łukasz Magiera
2019-07-24 01:47:36 +02:00
parent 4f1946d5a2
commit 4c8b028887
3 changed files with 16 additions and 4 deletions
+5 -1
View File
@@ -21,7 +21,11 @@ var initCmd = &cli.Command{
return err
}
if r.Exists() {
ok, err := r.Exists()
if err != nil {
return err
}
if ok {
return xerrors.Errorf("repo at '%s' is already initialized", cctx.String(FlagStorageRepo))
}
+5 -1
View File
@@ -36,7 +36,11 @@ var runCmd = &cli.Command{
return err
}
if !r.Exists() {
ok, err := r.Exists()
if err != nil {
return err
}
if !ok {
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-storage-miner init' to set it up", cctx.String(FlagStorageRepo))
}