Skip to content

Commit

Permalink
Merge pull request #2270 from guillaumewuip/better_apps_destroy
Browse files Browse the repository at this point in the history
Allow apps:destroy when not in a project
  • Loading branch information
michaelshobbs committed Jun 26, 2016
2 parents 2b019ae + 8d14d15 commit 80d1323
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contrib/dokku_client.sh
Expand Up @@ -33,6 +33,14 @@ client_help_msg() {
exit 20 # exit with specific status. only used in units tests for now
}

is_git_repo() {
git rev-parse &>/dev/null
}

has_dokku_remote() {
git remote show | grep dokku
}

if [[ -z $DOKKU_HOST ]]; then
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
Expand Down Expand Up @@ -81,7 +89,7 @@ if [[ ! -z $DOKKU_HOST ]]; then
fi
;;
apps:destroy)
git remote remove dokku
is_git_repo && has_dokku_remote && git remote remove dokku
;;
esac

Expand Down

0 comments on commit 80d1323

Please sign in to comment.