File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ file_env() {
4242# check to see if this file is being run or sourced from another script
4343_is_sourced () {
4444 # https://unix.stackexchange.com/a/215279
45- [ " ${FUNCNAME[${#FUNCNAME[@]} - 1]}" == ' source' ]
45+ [ " ${# FUNCNAME[@]} " -ge 2 ] \
46+ && [ " ${FUNCNAME[0]} " = ' _is_sourced' ] \
47+ && [ " ${FUNCNAME[1]} " = ' source' ]
4648}
4749
4850# usage: docker_process_init_files [file [file [...]]]
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ file_env() {
4242# check to see if this file is being run or sourced from another script
4343_is_sourced () {
4444 # https://unix.stackexchange.com/a/215279
45- [ " ${FUNCNAME[${#FUNCNAME[@]} - 1]}" == ' source' ]
45+ [ " ${# FUNCNAME[@]} " -ge 2 ] \
46+ && [ " ${FUNCNAME[0]} " = ' _is_sourced' ] \
47+ && [ " ${FUNCNAME[1]} " = ' source' ]
4648}
4749
4850# usage: docker_process_init_files [file [file [...]]]
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ file_env() {
4242# check to see if this file is being run or sourced from another script
4343_is_sourced () {
4444 # https://unix.stackexchange.com/a/215279
45- [ " ${FUNCNAME[${#FUNCNAME[@]} - 1]}" == ' source' ]
45+ [ " ${# FUNCNAME[@]} " -ge 2 ] \
46+ && [ " ${FUNCNAME[0]} " = ' _is_sourced' ] \
47+ && [ " ${FUNCNAME[1]} " = ' source' ]
4648}
4749
4850# usage: docker_process_init_files [file [file [...]]]
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ file_env() {
4242# check to see if this file is being run or sourced from another script
4343_is_sourced () {
4444 # https://unix.stackexchange.com/a/215279
45- [ " ${FUNCNAME[${#FUNCNAME[@]} - 1]}" == ' source' ]
45+ [ " ${# FUNCNAME[@]} " -ge 2 ] \
46+ && [ " ${FUNCNAME[0]} " = ' _is_sourced' ] \
47+ && [ " ${FUNCNAME[1]} " = ' source' ]
4648}
4749
4850# usage: docker_process_init_files [file [file [...]]]
You can’t perform that action at this time.
0 commit comments