refactor: move pre-receive hook modification to post-app-clone-setup trigger

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-17 06:21:08 -05:00
parent 5801fd98a4
commit 5dd297bb49
2 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-git-post-app-clone-setup() {
declare desc="modifies git-hook"
declare trigger="post-app-clone-setup"
declare OLD_APP="$1" NEW_APP="$2"
[[ -f "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive" ]] && sed -i -e "s/git-hook $OLD_APP/git-hook $NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/hooks/pre-receive"
}
trigger-git-post-app-clone-setup "$@"