Enable sourcing script on commandline

This commit is contained in:
Ben Peddell 2017-08-26 14:20:21 +10:00
parent 19f47f244b
commit 55e0e9fa16

View File

@ -3346,7 +3346,7 @@ main(){
# Only execute main function if script is not being sourced # Only execute main function if script is not being sourced
# by another script # by another script
if [[ "$(caller)" =~ ^0 ]]; then if [[ "$0" = "${BASH_SOURCE[0]}" || -z "${BASH_SOURCE}" ]]; then
main "$@" main "$@"
fi fi