Skip to content

Commit

Permalink
Fix installing local dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sschmid committed Sep 28, 2022
1 parent 73cb7f4 commit ab2fb09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/bee-run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -783,14 +783,15 @@ 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
BEE_LOAD_PLUGIN_NAME="${BEE_RESOLVE_PLUGIN_NAME}"
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
Expand Down
7 changes: 6 additions & 1 deletion test/fixtures/beerc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions test/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ab2fb09

Please sign in to comment.