Skip to content

Commit

Permalink
Fix arguments for sourced script
Browse files Browse the repository at this point in the history
Shifts around the arguments and updates $0 so that they would be as you
expect if the script was exec'd instead of source'd
  • Loading branch information
baodrate committed Dec 7, 2023
1 parent 2de0c23 commit bcc17b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bashio
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ __BASHIO_LIB_DIR=$(dirname "${__BASHIO_BIN}")
source "${__BASHIO_LIB_DIR}/bashio.sh"

# Execute source
BASH_ARGV0=${1:?script to source must be provided}
shift
# shellcheck source=/dev/null
source "$@"
source "$0" "$@"

0 comments on commit bcc17b9

Please sign in to comment.