FuelLabs/forc-wallet

Add a `--force` option to `forc wallet new`

sdankel opened this issue · 2 comments

Some feedback from the hacker house
In the context of forc wallet, creating a new wallet, you might face the following scenario:

forc wallet new
   Please enter a password to encrypt this private key:
   Please confirm your password:
   Error: File or directory already exists at "/home/sandusky/.fuel/wallets/.wallet". Remove the existing file, or provide a different path.

We should improve the UX by

  1. Allow the user to replace the wallet without leaving the workflow
Or even, an option in this CLI flow like
forc wallet new
   Please enter a password to encrypt this private key:
   Please confirm your password:
   There is an existing wallet at "/home/sandusky/.fuel/wallets/.wallet". Do you wish to replace it with a new wallet? (y/N) 
  1. Add the option to run forc wallet new --force which automatically removes the existing wallet, if it's there.

@sdankel Hi, I draft an PR #148 for this issue just now, looking forward for your review and suggestion👋

Thanks @levisyin for your contribution!