Files
dotfiles/scripts/shared.sh
Ismo Vuorinen cf7ca2109f feat: add bats tests, docs (#139)
* fix(test): ensure bats file list uses xargs

* docs(readme): use yarn for testing instructions

* fix(test): ensure pipelines fail properly

* docs(alias): fix table header

---------

Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-06-30 04:30:06 +03:00

21 lines
640 B
Bash
Executable File

#!/usr/bin/env bash
# Shared bash functions and helpers.
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
: "${VERBOSE:=0}"
# Set variable that checks if the shared.sh script has been
# sourced only once If the script has been sourced more than once,
# the script not be sourced again.
[ -z "$SHARED_SCRIPTS_SOURCED" ] && {
source "${DOTFILES}/config/shared.sh"
# Warn the user if the shared configuration hasn't been loaded yet
msgr warn "(!) shared.sh not sourced"
# Set variable that checks if the shared.sh script has been
# sourced only once.
# shellcheck disable=SC2034
export SHARED_SCRIPTS_SOURCED=1
}