Skip to content

Commit 0ad398f

Browse files
author
Matthew Fisher
committed
Merge pull request #2571 from jparkerCAA/protectGitRemote
fix(client): avoid git remote deletion when app specified by -a
2 parents 787aac1 + 68ab344 commit 0ad398f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

client/deis.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,10 @@ def apps_destroy(self, args):
504504
name for the application.
505505
"""
506506
app = args.get('--app')
507+
delete_remote = False
507508
if not app:
508509
app = self._session.app
510+
delete_remote = True
509511
confirm = args.get('--confirm')
510512
if confirm == app:
511513
pass
@@ -532,8 +534,9 @@ def apps_destroy(self, args):
532534
requests.codes.not_found):
533535
self._logger.info('done in {}s'.format(int(time.time() - before)))
534536
try:
535-
# If the requested app is a heroku app, delete the git remote
536-
if self._session.is_git_app():
537+
# If the requested app is a heroku app and the app
538+
# was inferred from session, delete the git remote
539+
if self._session.is_git_app() and delete_remote:
537540
subprocess.check_call(
538541
['git', 'remote', 'rm', 'deis'],
539542
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)