mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
26 lines
1 KiB
Bash
Executable file
26 lines
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# ==============================================================================
|
|
# Home Assistant Community Add-ons: Bashio
|
|
# Bashio is an bash function library for use with Home Assistant add-ons.
|
|
#
|
|
# It contains a set of commonly used operations and can be used
|
|
# to be included in add-on scripts to reduce code duplication across add-ons.
|
|
# ==============================================================================
|
|
set -o errexit # Exit script when a command exits with non-zero status
|
|
set -o errtrace # Exit on error inside any functions or sub-shells
|
|
set -o nounset # Exit script on use of an undefined variable
|
|
set -o pipefail # Return exit status of the last command in the pipe that failed
|
|
|
|
export __BASHIO_BIN
|
|
export __BASHIO_LIB_DIR
|
|
|
|
__BASHIO_BIN=$(readlink -f "${BASH_SOURCE[0]}")
|
|
__BASHIO_LIB_DIR=$(dirname "${__BASHIO_BIN}")
|
|
|
|
# Include Bashio library
|
|
# shellcheck source=lib/bashio.sh
|
|
source "${__BASHIO_LIB_DIR}/bashio.sh"
|
|
|
|
# Execute source
|
|
# shellcheck source=/dev/null
|
|
source "$@"
|