refactor: use fn-git-create-hook

This commit is contained in:
Jose Diaz-Gonzalez committed 2025-10-25 07:20:17 -04:00
1 parent efd25cfb45
commit 8afe8d5f13
2 files changed
+4 -6

No files matched your search

+2 -3
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
source "$PLUGIN_AVAILABLE_PATH/git/internal-functions"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $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" 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 popd &>/dev/null || pushd "/tmp" >/dev/null
if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then fn-git-create-hook "$NEW_APP"
sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
fi
} }
trigger-git-post-app-clone-setup "$@" trigger-git-post-app-clone-setup "$@"
+2 -3
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
source "$PLUGIN_AVAILABLE_PATH/git/internal-functions"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $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" 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 popd &>/dev/null || pushd "/tmp" >/dev/null
if [[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]]; then fn-git-create-hook "$NEW_APP"
sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
fi
} }
trigger-git-post-app-rename-setup "$@" trigger-git-post-app-rename-setup "$@"