reynhout / chrx

Chromebook Unix
419 stars 56 forks source link

Using `read -e PROMPT_RESPONSE` would allow user to backspace if they make a typo #115

Closed espoelstra closed 3 years ago

espoelstra commented 3 years ago

https://github.com/reynhout/chrx/blob/671e8a2b73e88b068c383dad5d8a52feae3d9bec/chrx-install#L130

I noticed this was an issue in the official linux_recovery.sh from Google as well, where if you make a typo you can't backspace, and if the script doesn't re-prompt if the input was invalid for that particular prompt you end up having to Ctrl+C to abort and start over.

Since some of the parts of chrx are currently a little destructive like the early format of $(rootdisk -s -d)p7 before the user has accepted the risk of data loss if they'd already installed something via Chrx in the past, it would be good to avoid making them restart the script too many times, and keeping the destructive portions after the user has acknowledged their potential data loss.

reynhout commented 3 years ago

@espoelstra Great point! Will fix shortly.