diff --git a/scripts/install.sh b/scripts/install.sh index 8da7768..31de3ef 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -144,13 +144,14 @@ elif [ "$mode" = "user" ]; then # Plugins if [ "$with_plugins" = "yes" ]; then if [ -f "$src/marketplaces.json" ] && [ -f "$src/plugins-manifest.json" ]; then - # Map mode (user|project) to install-target (user|consumer) - plugin_target="user" - [ "$mode" = "project" ] && plugin_target="consumer" + # NOTE: this plugin-install block currently only runs in user mode + # (it sits inside `elif [ "$mode" = "user" ]` above). Future consumer-mode + # plugin install would need a separate block in the `if [ "$mode" = "project" ]` + # branch above, passing --install-target=consumer. bash "$SCRIPT_DIR/lib/install-plugins.sh" \ --marketplaces="$src/marketplaces.json" \ --manifest="$src/plugins-manifest.json" \ - --install-target="$plugin_target" || exit 6 + --install-target=user || exit 6 fi fi fi diff --git a/scripts/lib/install-plugins.sh b/scripts/lib/install-plugins.sh index 07b1829..4c01269 100644 --- a/scripts/lib/install-plugins.sh +++ b/scripts/lib/install-plugins.sh @@ -79,6 +79,10 @@ case "$install_target" in consumer) filter='.plugins | to_entries[] | select(.value[0].target == "consumer" or .value[0].target == "user-level+consumer") | .key' ;; + *) + log_error "internal: unhandled install_target=$install_target (should have been validated above)" + exit 1 + ;; esac for plugin in $(jq -r "$filter" "$manifest"); do