Skip to content

Commit 5a4b092

Browse files
committed
use global variable
1 parent dd56511 commit 5a4b092

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/compas_rhino/install.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
'install',
1717
'installable_rhino_packages',
1818
'after_rhino_install',
19+
'INSTALLED_VERSION'
1920
]
2021

22+
INSTALLED_VERSION = None
2123

2224
def install(version=None, packages=None, clean=False):
2325
"""Install COMPAS for Rhino.
@@ -195,13 +197,16 @@ def install(version=None, packages=None, clean=False):
195197

196198
if exit_code == 0 and len(installed_packages):
197199
print('\nRunning post-installation steps...\n')
198-
if not _run_post_execution_steps(after_rhino_install(installed_packages, version)):
200+
if not _run_post_execution_steps(after_rhino_install(installed_packages)):
199201
exit_code = -1
200202

201203
print('\nInstall completed.')
202204
if exit_code != 0:
203205
sys.exit(exit_code)
204206

207+
global INSTALLED_VERSION
208+
INSTALLED_VERSION = version
209+
205210

206211
def _run_post_execution_steps(steps_generator):
207212
all_steps_succeeded = True
@@ -265,7 +270,7 @@ def installable_rhino_packages():
265270

266271

267272
@compas.plugins.pluggable(category='install', selector='collect_all')
268-
def after_rhino_install(installed_packages, version):
273+
def after_rhino_install(installed_packages):
269274
"""Allows extensions to execute actions after install to Rhino is done.
270275
271276
Extensions providing Rhino or Grasshopper features

0 commit comments

Comments
 (0)