diff --git a/src/bee-run.bash b/src/bee-run.bash index fbf976d..77c4d6e 100644 --- a/src/bee-run.bash +++ b/src/bee-run.bash @@ -320,7 +320,7 @@ bee::install::recursively() { ((found)) && break done if ((!found)); then - bee::load_plugin "${plugin}" + bee::load_plugin "${plugin}" 1 if [[ -n "${BEE_LOAD_PLUGIN_NAME}" ]]; then echo -e "${indent}${bullet}${BEE_LOAD_PLUGIN_NAME}:local (${BEE_LOAD_PLUGIN_PATH})" if [[ -f "${BEE_LOAD_PLUGIN_JSON_PATH}" ]]; then @@ -783,6 +783,7 @@ BEE_LOAD_PLUGIN_JSON_PATH="" declare -Ag BEE_LOAD_PLUGIN_LOADED=() BEE_LOAD_PLUGIN_MISSING=() bee::load_plugin() { + local -i ignore_missing=${2:-0} BEE_LOAD_PLUGIN_MISSING=() bee::mapped_plugin "$1" if [[ -n "${BEE_RESOLVE_PLUGIN_FULL_PATH}" ]]; then @@ -790,7 +791,7 @@ bee::load_plugin() { BEE_LOAD_PLUGIN_PATH="${BEE_RESOLVE_PLUGIN_FULL_PATH}" BEE_LOAD_PLUGIN_JSON_PATH="${BEE_RESOLVE_PLUGIN_JSON_PATH}" bee::load_plugin_deps - if [[ ${#BEE_LOAD_PLUGIN_MISSING[@]} -gt 0 ]]; then + if [[ $ignore_missing -eq 0 && ${#BEE_LOAD_PLUGIN_MISSING[@]} -gt 0 ]]; then for missing in "${BEE_LOAD_PLUGIN_MISSING[@]}"; do bee::log_error "Missing plugin: '${missing}'" done diff --git a/test/fixtures/beerc.bash b/test/fixtures/beerc.bash index 569c489..0b5eef1 100644 --- a/test/fixtures/beerc.bash +++ b/test/fixtures/beerc.bash @@ -9,7 +9,12 @@ BEE_HUBS=( ) BEE_CACHES_PATH="${BATS_TEST_TMPDIR}/caches" -if [[ -v TEST_BEE_PLUGINS_PATHS_CUSTOM ]]; then +if [[ -v TEST_BEE_PLUGINS_NEED_INSTALL ]]; then + BEE_PLUGINS_PATHS=( + "${BEE_CACHES_PATH}/plugins" + "${BATS_TEST_DIRNAME}/fixtures/custom_plugins" + ) +elif [[ -v TEST_BEE_PLUGINS_PATHS_CUSTOM ]]; then BEE_PLUGINS_PATHS=( "${BATS_TEST_DIRNAME}/fixtures/plugins" "${BATS_TEST_DIRNAME}/fixtures/custom_plugins" diff --git a/test/install.bats b/test/install.bats index 38f7088..db3573d 100644 --- a/test/install.bats +++ b/test/install.bats @@ -2,6 +2,7 @@ setup() { load "test-helper.bash" load "test-helper-hub.bash" _set_beerc + export TEST_BEE_PLUGINS_NEED_INSTALL=1 _source_beerc } @@ -157,8 +158,6 @@ EOF } @test "installs local plugins with dependencies recursively" { - # shellcheck disable=SC2030,SC2031 - export TEST_BEE_PLUGINS_PATHS_CUSTOM=1 export TEST_PLUGIN_QUIET=1 _setup_test_bee_hub_repo _setup_testplugin_repo