Skip to content

Commit

Permalink
Add prompt for user confirmation.
Browse files Browse the repository at this point in the history
Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller committed Nov 10, 2023
1 parent a277f2f commit bd45a3a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/keri/app/cli/commands/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
required=False, default="")
parser.add_argument('--passcode', '-p', help='22 character encryption passcode for keystore (is not saved)',
dest="bran", default=None) # passcode => bran
parser.add_argument('--force', action="store_true", required=False,
help='True means perform migration without prompting the user')

StateEstEvent = namedtuple("StateEstEvent", 's d br ba')

Expand Down Expand Up @@ -158,6 +160,17 @@ class KeyStateRecord(RawRecord): # baser.state


def handler(args):
if not args.force:
print()
print("This command will migrate your datastore to the next version of KERIpy and is not reversible.")
print("After this command, you will not be able to access your data store with this version.")
print()
yn = input("Are you sure you want to continue? [y|N]: ")

if yn not in ("y", "Y"):
print("...exiting")
return []

kwa = dict(args=args)
return [doing.doify(migrate, **kwa)]

Expand Down

0 comments on commit bd45a3a

Please sign in to comment.