add default answer and add compliance with shellcheck

This commit is contained in:
Simon Vieille 2019-07-31 20:49:59 +02:00
父節點 faeb8492b7
當前提交 4398347162
簽署人: deblan
GPG Key ID: 03383D15A1D31745
共有 3 個文件被更改,包括 6 次插入4 次删除

查看文件

@ -99,7 +99,7 @@ chmod 600 "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE"
CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?")"
CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?" -n)"
if [ "$CONTINUE" = "no" ]; then
printf "Aborded!\\n"

查看文件

@ -5,13 +5,15 @@ LABEL=
ERROR=0
HEIGHT=8
WIDTH=50
PARAMS=
while getopts "t:l:d:h:w:r" option; do
while getopts "t:l:d:h:w:rn" option; do
case "$option" in
l) LABEL="$OPTARG";;
t) TITLE="$OPTARG";;
h) HEIGHT="$OPTARG";;
w) WIDTH="$OPTARG";;
n) PARAMS="$PARAMS --defaultno";;
:) ERROR=1;;
?) ERROR=1;;
esac
@ -21,7 +23,7 @@ if [ $ERROR -eq 1 ]; then
exit 1
fi
if (whiptail --title "$TITLE" --yesno "$LABEL" $HEIGHT $WIDTH 3>&1 1>&2 2>&3) then
if (whiptail --title "$TITLE" --yesno "$LABEL" $PARAMS $HEIGHT $WIDTH 3>&1 1>&2 2>&3) then
printf "yes"
else
printf "no"

查看文件

@ -2,4 +2,4 @@
. ./etc/config
$PHP_BIN -dvariables_order=EGPCS ./share/bin/twigc -E -d ./src/templates/ < "src/templates/${1}.twig"
"$PHP_BIN" -dvariables_order=EGPCS ./share/bin/twigc -E -d ./src/templates/ < "src/templates/${1}.twig"