Skip to content

Commit 7b6ef0d

Browse files
committed
exit codes
1 parent 06b58f4 commit 7b6ef0d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/compas_rhino/install.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ def install(version=None, packages=None):
115115
if status != 'OK':
116116
exit_code = -1
117117

118-
if len(installed_packages):
118+
if exit_code == 0 and len(installed_packages):
119119
print()
120120
print('Running post-installation steps...')
121121
print()
122-
_run_post_execution_steps(after_rhino_install(installed_packages))
122+
if not _run_post_execution_steps(after_rhino_install(installed_packages)):
123+
exit_code = -1
123124

124125
print('\nCompleted.')
125126
if exit_code != 0:
@@ -148,6 +149,9 @@ def _run_post_execution_steps(steps_generator):
148149
for error in post_execution_errors:
149150
print(' - {}'.format(repr(error)))
150151

152+
return False
153+
154+
return True
151155

152156
@compas.plugins.plugin(category='install', pluggable_name='installable_rhino_packages', tryfirst=True)
153157
def default_installable_rhino_packages():

src/compas_rhino/uninstall.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ def uninstall(version=None, packages=None):
101101
if status != 'OK':
102102
exit_code = -1
103103

104-
if len(uninstalled_packages):
104+
if exit_code == 0 and len(uninstalled_packages):
105105
print()
106106
print('Running post-uninstallation steps...')
107107
print()
108-
_run_post_execution_steps(after_rhino_uninstall(uninstalled_packages))
108+
if not _run_post_execution_steps(after_rhino_uninstall(uninstalled_packages)):
109+
exit_code = -1
109110

110111
print('\nUninstall completed.')
111112
if exit_code != 0:

0 commit comments

Comments
 (0)