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