Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/lib/_loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Helper to bootstrap libraries. This file sources all library files so functions will be defined and available.
Basically, you need to source this file in any script where you want to use library functions.

Also, you can extend this loader to load your local library files too!
Create your loader script that sources the local libraries and just point `ES_SHELL_LOADER_LOCAL` environment variable to it (e.g. `ES_SHELL_LOADER_LOCAL=$HOME/.local/lib/myloader.sh`), and they will be sourced.

**Usage in scripts**

```bash
Expand Down
5 changes: 5 additions & 0 deletions lib/_loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ base_dir=$(cd "$(dirname "${path_self}")" >/dev/null 2>&1 && pwd)
. "${base_dir}/ssh.sh"
. "${base_dir}/text.sh"
. "${base_dir}/ui.sh"

if [[ -r "${ES_SHELL_LOADER_LOCAL:-}" ]]; then
# shellcheck disable=SC1090
. "${ES_SHELL_LOADER_LOCAL}"
fi