Skip to content

Commit c1e23d5

Browse files
committed
deis destroy removes git remote only if it matches app, fixes #544.
1 parent 6c902a6 commit c1e23d5

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

client/deis.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,14 @@ def apps_destroy(self, args):
521521
if response.status_code in (requests.codes.no_content, # @UndefinedVariable
522522
requests.codes.not_found): # @UndefinedVariable
523523
print('done in {}s'.format(int(time.time() - before)))
524+
# If the requested app is in the current dir, delete the git remote
524525
try:
525-
subprocess.check_call(
526-
['git', 'remote', 'rm', 'deis'],
527-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
528-
print('Git remote deis removed')
529-
except subprocess.CalledProcessError:
526+
if app == self._session.app:
527+
subprocess.check_call(
528+
['git', 'remote', 'rm', 'deis'],
529+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
530+
print('Git remote deis removed')
531+
except (EnvironmentError, subprocess.CalledProcessError):
530532
pass # ignore error
531533
else:
532534
raise ResponseError(response)

0 commit comments

Comments
 (0)