You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function is supposed to load a library file (source lib.sh) relative to the script's current folder and properly deal with the errors, such as not being able to find the library file.
Something like this:
functionload_lib() {
local lib_file=$1# shellcheck disable=SC1090source"$(cd "$(dirname "${BASH_SOURCE[0]}")"&& pwd)/$lib_file"|| die "[ERROR] Not able to load the library $lib_file"
}
laod_lib "../common.sh"
load_lib "lib.sh"
With the template:
# DEFINE_LOAD_LIB
The text was updated successfully, but these errors were encountered:
This function is supposed to load a library file (
source lib.sh
) relative to the script's current folder and properly deal with the errors, such as not being able to find the library file.Something like this:
With the template:
# DEFINE_LOAD_LIB
The text was updated successfully, but these errors were encountered: