Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passphrase confirmation to be read from non-tty #2191

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

jrick
Copy link
Member

@jrick jrick commented Nov 9, 2022

This allows piping the answers to the --create prompts to work properly for not only the initial passphrase prompt, but the confirmation as well. Seems to have been missed the last time this code was touched.

$ cat answers.txt                                                                                                                     
banana
banana
no
yes
0001020304050607080910111213141516171819202122232425262728293031
$ dcrwallet --appdata=/tmp/tmpwallet --create <answers.txt 
2022-11-09 10:41:30.988 [WRN] DCRW: open /tmp/tmpwallet/dcrwallet.conf: no such file or directory
Enter the private passphrase for your new wallet: 
Confirm passphrase: 
Do you want to add an additional layer of encryption for public data? (n/no/y/yes) [no]: Do you have an existing wallet seed you want to use? (n/no/y/yes) [no]: Enter existing wallet seed (followed by a blank line): 
Seed input successful. 
Hex: 0102030405060708091011121314151617181920212223242526272829303132
Creating the wallet...
2022-11-09 10:41:33.307 [INF] WLLT: Upgrading database from version 1 to 25
2022-11-09 10:41:36.617 [INF] WLLT: Opened wallet
The wallet has been created successfully.

@jrick jrick changed the title Allow passphrace confirmation to be read from non-tty Allow passphrase confirmation to be read from non-tty Nov 9, 2022
This allows piping the answers to the --create prompts to work
properly for not only the initial passphrase prompt, but the
confirmation as well.  Seems to have been missed the last time this
code was touched.
@jrick jrick force-pushed the noninteractive_pass_confirmation branch from c423f66 to dd93c2f Compare November 9, 2022 15:45
@jrick jrick merged commit dd93c2f into decred:master Nov 9, 2022
@jrick jrick deleted the noninteractive_pass_confirmation branch November 9, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants