Skip to content

Commit

Permalink
Merge pull request deis#2571 from jparkerCAA/protectGitRemote
Browse files Browse the repository at this point in the history
fix(client): avoid git remote deletion when app specified by -a
  • Loading branch information
Matthew Fisher committed Dec 12, 2014
2 parents 787aac1 + 68ab344 commit 0ad398f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/deis.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,10 @@ def apps_destroy(self, args):
name for the application.
"""
app = args.get('--app')
delete_remote = False
if not app:
app = self._session.app
delete_remote = True
confirm = args.get('--confirm')
if confirm == app:
pass
Expand All @@ -532,8 +534,9 @@ def apps_destroy(self, args):
requests.codes.not_found):
self._logger.info('done in {}s'.format(int(time.time() - before)))
try:
# If the requested app is a heroku app, delete the git remote
if self._session.is_git_app():
# If the requested app is a heroku app and the app
# was inferred from session, delete the git remote
if self._session.is_git_app() and delete_remote:
subprocess.check_call(
['git', 'remote', 'rm', 'deis'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Expand Down

0 comments on commit 0ad398f

Please sign in to comment.