clean up remove clone folder fn

This commit is contained in:
arturs
2021-03-12 09:24:41 +02:00
parent 4e50214b80
commit f9be3dd974

View File

@@ -246,16 +246,12 @@ cmd-git-unlock() {
if [[ -d "$APP_CLONE_ROOT" ]]; then
if [[ "$FLAG" == "--force" ]]; then
dokku_log_info1 "About to delete $APP_CLONE_ROOT"
rm -rf "$APP_CLONE_ROOT"
dokku_log_info1 "Successfully unlocked $APP"
fn-git-remove-clone-folder "$APP_CLONE_ROOT"
else
read -rp "Are you sure that want to delete clone folder (y/n)?" choice
case "$choice" in
y | Y)
dokku_log_info1 "About to delete $APP_CLONE_ROOT"
rm -rf "$APP_CLONE_ROOT"
dokku_log_info1 "Successfully unlocked $APP"
fn-git-remove-clone-folder "$APP_CLONE_ROOT"
;;
n | N) echo "no" ;;
*) echo "please answer with yes or no" ;;
@@ -351,6 +347,13 @@ fn-git-auth-error() {
dokku_log_fail "As an alternative, configure the netrc authentication via the git:auth command"
}
fn-git-remove-clone-folder() {
declare APP_CLONE_ROOT="$1"
dokku_log_info1 "About to delete $APP_CLONE_ROOT"
rm -rf "$APP_CLONE_ROOT"
dokku_log_info1 "Successfully deleted $APP_CLONE_ROOT"
}
fn-git-create-hook() {
declare APP="$1"
local APP_PATH="$DOKKU_ROOT/$APP"