diff --git a/plugins/git/post-app-clone-setup b/plugins/git/post-app-clone-setup index 89396095e..8d9939d5c 100755 --- a/plugins/git/post-app-clone-setup +++ b/plugins/git/post-app-clone-setup @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" +source "$PLUGIN_AVAILABLE_PATH/git/internal-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x @@ -14,9 +15,7 @@ trigger-git-post-app-clone-setup() { find ./* \( -name ".cache" -o -name "cache" -o -name "VHOST" -o -name "URLS" \) -prune -o -print | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" popd &>/dev/null || pushd "/tmp" >/dev/null - if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then - sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" - fi + fn-git-create-hook "$NEW_APP" } trigger-git-post-app-clone-setup "$@" diff --git a/plugins/git/post-app-rename-setup b/plugins/git/post-app-rename-setup index 2948823ad..1398cabd1 100755 --- a/plugins/git/post-app-rename-setup +++ b/plugins/git/post-app-rename-setup @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" +source "$PLUGIN_AVAILABLE_PATH/git/internal-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x @@ -15,9 +16,7 @@ trigger-git-post-app-rename-setup() { find ./* \( -name ".cache" -o -name "cache" -o -name "VHOST" -o -name "URLS" \) -prune -o -print | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" popd &>/dev/null || pushd "/tmp" >/dev/null - if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then - sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" - fi + fn-git-create-hook "$NEW_APP" } trigger-git-post-app-rename-setup "$@"