You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-28 10:42:06 +03:00
Improve _is_sourced check
This commit is contained in:
@ -27,7 +27,9 @@ file_env() {
|
||||
# check to see if this file is being run or sourced from another script
|
||||
_is_sourced() {
|
||||
# https://unix.stackexchange.com/a/215279
|
||||
[ "${FUNCNAME[${#FUNCNAME[@]} - 1]}" == 'source' ]
|
||||
[ "${#FUNCNAME[@]}" -ge 2 ] \
|
||||
&& [ "${FUNCNAME[0]}" = '_is_sourced' ] \
|
||||
&& [ "${FUNCNAME[1]}" = 'source' ]
|
||||
}
|
||||
|
||||
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
|
||||
|
Reference in New Issue
Block a user