mirror of https://git.envs.net/envs/burrow.git
fixing yesno prompt for bsd
This commit is contained in:
parent
9b6f3daeb1
commit
982eb95372
19
burrow
19
burrow
|
@ -567,13 +567,10 @@ edit_config () {
|
|||
}
|
||||
|
||||
yesno () {
|
||||
printf "%s \\n" "$1"
|
||||
old_stty_cfg=$(stty -g)
|
||||
stty raw -echo
|
||||
yn=$(while ! head -c 1 | grep -i '[ny]'; do true; done)
|
||||
stty "$old_stty_cfg"
|
||||
printf "%s " "$1"
|
||||
read -r yn
|
||||
case $yn in
|
||||
y ) result=0 ;;
|
||||
[Yy]* ) result=0 ;;
|
||||
* ) result=1 ;;
|
||||
esac
|
||||
return $result
|
||||
|
@ -591,22 +588,22 @@ quickstart () {
|
|||
if yesno "Create a phlog? "; then
|
||||
printf "Phlog directory? (relative to root of gopher site) "
|
||||
read -r config_dir_phlog
|
||||
if yesno "Include gophermap"; then
|
||||
if yesno "Include gophermap? "; then
|
||||
config_phlog_gophermap=true
|
||||
else
|
||||
config_phlog_gophermap=false
|
||||
fi
|
||||
if yesno "Include the date in your phlog posts"; then
|
||||
if yesno "Include the date in your phlog posts? "; then
|
||||
config_phlog_usedate=true
|
||||
else
|
||||
config_phlog_usedate=false
|
||||
fi
|
||||
if yesno "Auto-commit to git repo"; then
|
||||
if yesno "Auto-commit to git repo? "; then
|
||||
config_git_commit=true
|
||||
else
|
||||
config_git_commit=false
|
||||
fi
|
||||
if yesno "Auto-push to git remote"; then
|
||||
if yesno "Auto-push to git remote? "; then
|
||||
config_git_push=true
|
||||
else
|
||||
config_git_push=false
|
||||
|
@ -616,7 +613,7 @@ quickstart () {
|
|||
else
|
||||
config_autoindent=false
|
||||
fi
|
||||
if yesno "Auto-generate phlog RSS"; then
|
||||
if yesno "Auto-generate phlog RSS? "; then
|
||||
config_phlog_autorss=true
|
||||
printf "Name of gopher hole? "
|
||||
read -r config_gopher_name
|
||||
|
|
Loading…
Reference in New Issue