fix: use inline source instead of global source

Ensure property-functions are sourced only if not already defined.
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2026-05-04 09:32:09 -04:00
1 parent 49dc1c1e64
commit 473bcce688
1 file changed
+8 -1
+8 -1
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
has_tty() { has_tty() {
declare desc="return 0 if we have a tty" declare desc="return 0 if we have a tty"
@@ -637,6 +636,10 @@ release_and_deploy() {
local exit_code=0 local exit_code=0
if verify_image "$IMAGE"; then if verify_image "$IMAGE"; then
if ! declare -f -F fn-plugin-property-get-default >/dev/null; then
source "$PLUGIN_AVAILABLE_PATH/common/property-functions"
fi
IMAGE_SOURCE_TYPE="$(get_image_builder_type "$IMAGE" "$APP")" IMAGE_SOURCE_TYPE="$(get_image_builder_type "$IMAGE" "$APP")"
local DOKKU_APP_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "$APP" "skip-deploy" "")" local DOKKU_APP_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "$APP" "skip-deploy" "")"
local DOKKU_GLOBAL_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "--global" "skip-deploy" "")" local DOKKU_GLOBAL_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "--global" "skip-deploy" "")"
@@ -976,6 +979,10 @@ fn-migrate-config-to-property() {
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions"
fi fi
if ! declare -f -F fn-plugin-property-write >/dev/null; then
source "$PLUGIN_AVAILABLE_PATH/common/property-functions"
fi
if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then
local value=$(plugn trigger config-get-global "$GLOBAL_CONFIG_VAR" || true) local value=$(plugn trigger config-get-global "$GLOBAL_CONFIG_VAR" || true)
if [[ -n "$value" ]]; then if [[ -n "$value" ]]; then