mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Replace $_ in error trap (#1776)
This commit is contained in:
parent
7fd6751e89
commit
70267d89e5
|
@ -121,7 +121,7 @@ A construct to trace error in your scripts looks like this. Remember: Remove `se
|
||||||
|
|
||||||
``` BASH
|
``` BASH
|
||||||
set -xeuEo pipefail
|
set -xeuEo pipefail
|
||||||
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
||||||
|
|
||||||
SCRIPT='name_of_this_script.sh'
|
SCRIPT='name_of_this_script.sh'
|
||||||
|
|
||||||
|
|
2
setup.sh
2
setup.sh
|
@ -7,7 +7,7 @@
|
||||||
SCRIPT='setup.sh'
|
SCRIPT='setup.sh'
|
||||||
|
|
||||||
set -euEo pipefail
|
set -euEo pipefail
|
||||||
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
||||||
trap '_unset_vars || :' EXIT
|
trap '_unset_vars || :' EXIT
|
||||||
|
|
||||||
function __log_err
|
function __log_err
|
||||||
|
|
|
@ -24,7 +24,7 @@ _get_current_directory
|
||||||
# ? ––––––––––––––––––––––––––––––––––––––––––––– ERRORS
|
# ? ––––––––––––––––––––––––––––––––––––––––––––– ERRORS
|
||||||
|
|
||||||
set -eEuo pipefail
|
set -eEuo pipefail
|
||||||
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
|
||||||
|
|
||||||
function __log_err
|
function __log_err
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue