fix: move fn-git-create-hook to internal-functions

Its unused elsewhere.
This commit is contained in:
Jose Diaz-Gonzalez committed 2021-01-17 17:00:33 -05:00
1 parent 1a66102e30
commit 31332a5061
4 files changed
+21 -21

No files matched your search

-19
View File
@@ -234,22 +234,3 @@ cmd-git-glob() {
fi fi
git-shell -c "$args" git-shell -c "$args"
} }
fn-git-create-hook() {
declare APP="$1"
local APP_PATH="$DOKKU_ROOT/$APP"
local PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
if [[ ! -d "$APP_PATH/refs" ]]; then
git init --bare "$APP_PATH" >/dev/null
fi
cat >"$PRERECEIVE_HOOK" <<EOF
#!/usr/bin/env bash
set -e
set -o pipefail
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
EOF
chmod +x "$PRERECEIVE_HOOK"
}
+19
View File
@@ -167,6 +167,25 @@ cmd-git-report-single() {
fi fi
} }
fn-git-create-hook() {
declare APP="$1"
local APP_PATH="$DOKKU_ROOT/$APP"
local PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
if [[ ! -d "$APP_PATH/refs" ]]; then
git init --bare "$APP_PATH" >/dev/null
fi
cat >"$PRERECEIVE_HOOK" <<EOF
#!/usr/bin/env bash
set -e
set -o pipefail
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
EOF
chmod +x "$PRERECEIVE_HOOK"
}
fn-git-clone() { fn-git-clone() {
declare desc="creates an app from remote git repo" declare desc="creates an app from remote git repo"
declare APP="$1" GIT_REMOTE="$2" GIT_REF="$2" declare APP="$1" GIT_REMOTE="$2" GIT_REF="$2"
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_AVAILABLE_PATH/git/internal-functions"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/git/functions"
trigger-git-post-create() { trigger-git-post-create() {
declare desc="initializes an app with the correct git repository structure" declare desc="initializes an app with the correct git repository structure"
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/git/functions" source "$PLUGIN_AVAILABLE_PATH/git/internal-functions"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x