From c1397f2f6e6921d31598acde3ba96b86733e28e4 Mon Sep 17 00:00:00 2001 From: Scott Koranda Date: Fri, 31 Jul 2020 06:27:17 -0500 Subject: [PATCH] Better enablement of plugins (CO-1996) --- comanage-registry-base/comanage_utils.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/comanage-registry-base/comanage_utils.sh b/comanage-registry-base/comanage_utils.sh index 846766b..45c7122 100644 --- a/comanage-registry-base/comanage_utils.sh +++ b/comanage-registry-base/comanage_utils.sh @@ -172,21 +172,25 @@ function comanage_utils::enable_plugins() { # Enable any supported non-core plugins if requested. if [[ -n "$COMANAGE_REGISTRY_ENABLE_PLUGIN" ]]; then + # Clear the caches. + comanage_utils::registry_clear_cache + local plugins local plugin plugins=(`echo "$COMANAGE_REGISTRY_ENABLE_PLUGIN" | sed -e 's@,@ @g'`) > "$OUTPUT" 2>&1 + pushd "$COMANAGE_REGISTRY_DIR/local/Plugin" > "$OUTPUT" 2>&1 for plugin in "${plugins[@]}"; do echo "Enabling available plugin $plugin..." > "$OUTPUT" 2>&1 - pushd "$COMANAGE_REGISTRY_DIR/local/Plugin" > "$OUTPUT" 2>&1 ln -s "../../app/AvailablePlugin/$plugin" "$plugin" > "$OUTPUT" 2>&1 - popd > "$OUTPUT" 2>&1 - pushd "$COMANAGE_REGISTRY_DIR/app" > "$OUTPUT" 2>&1 - ./Console/cake database > "$OUTPUT" 2>&1 - popd > "$OUTPUT" 2>&1 done - # Clear the caches. + popd > "$OUTPUT" 2>&1 + pushd "$COMANAGE_REGISTRY_DIR/app" > "$OUTPUT" 2>&1 + ./Console/cake database > "$OUTPUT" 2>&1 + popd > "$OUTPUT" 2>&1 + + # Clear the caches again. comanage_utils::registry_clear_cache fi }