Skip to content

Commit

Permalink
main: work around "set -B" and "set -k"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Mar 7, 2022
1 parent 90d9284 commit 55494eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ble.pp
Expand Up @@ -73,6 +73,8 @@ function ble/base/adjust-bash-options {
_ble_bash_setx=; [[ -o xtrace ]] && _ble_bash_setx=1 && set +x
_ble_bash_setv=; [[ -o verbose ]] && _ble_bash_setv=1 && set +v
_ble_bash_setu=; [[ -o nounset ]] && _ble_bash_setu=1 && set +u
_ble_bash_setk=; [[ -o keyword ]] && _ble_bash_setk=1 && set +k
_ble_bash_setB=; [[ -o braceexpand ]] && _ble_bash_setB=1 || set -B

# Note: nocasematch は bash-3.0 以上
_ble_bash_nocasematch=
Expand Down Expand Up @@ -113,8 +115,10 @@ function ble/base/restore-bash-options {
ble/variable#copy-state _ble_bash_LC_ALL LC_ALL

[[ $_ble_bash_nocasematch ]] && shopt -s nocasematch
[[ $_ble_bash_setv && ! -o verbose ]] && set -v
[[ ! $_ble_bash_setB && -o braceexpand ]] && set +B
[[ $_ble_bash_setk && ! -o keyword ]] && set -k
[[ $_ble_bash_setu && ! -o nounset ]] && set -u
[[ $_ble_bash_setv && ! -o verbose ]] && set -v
[[ $_ble_bash_setx && ! -o xtrace ]] && set -x
[[ $_ble_bash_sete && ! -o errexit ]] && set -e
} 2>/dev/null # set -x 対策 #D0930
Expand Down

0 comments on commit 55494eb

Please sign in to comment.