lib: avoid duplicate inclusion

pull/1907/head
John D Pell 2021-09-12 13:34:50 -07:00
parent 78de57aeb5
commit 72186ce1d7
2 changed files with 18 additions and 2 deletions

11
lib/helpers.bash 100755 → 100644
View File

@ -1,4 +1,13 @@
#!/usr/bin/env bash
# shellcheck shell=bash
#
# A collection of reusable functions.
# Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_helpers:-}" ]]
then
return 0
fi
__bash_it_lib_helpers="loaded"
BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS=${BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS:-150}
BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN=${BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN:-250}

View File

@ -1,6 +1,13 @@
#!/usr/bin/env bash
# shellcheck shell=bash
#
# Search by Konstantin Gredeskoul «github.com/kigster»
# Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_search:-}" ]]
then
return 0
fi
__bash_it_lib_search="loaded"
#———————————————————————————————————————————————————————————————————————————————
# This function returns list of aliases, plugins and completions in bash-it,
# whose name or description matches one of the search terms provided as arguments.