Skip to content

Commit 68ab344

Browse files
author
jparkercaa
committed
fix(client): avoid git remote deletion for apps specified by -a
1 parent 2d1db8e commit 68ab344

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
@@ -492,8 +492,10 @@ def apps_destroy(self, args):
492492
name for the application.
493493
"""
494494
app = args.get('--app')
495+
delete_remote = False
495496
if not app:
496497
app = self._session.app
498+
delete_remote = True
497499
confirm = args.get('--confirm')
498500
if confirm == app:
499501
pass
@@ -520,8 +522,9 @@ def apps_destroy(self, args):
520522
requests.codes.not_found):
521523
self._logger.info('done in {}s'.format(int(time.time() - before)))
522524
try:
523-
# If the requested app is a heroku app, delete the git remote
524-
if self._session.is_git_app():
525+
# If the requested app is a heroku app and the app
526+
# was inferred from session, delete the git remote
527+
if self._session.is_git_app() and delete_remote:
525528
subprocess.check_call(
526529
['git', 'remote', 'rm', 'deis'],
527530
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)