We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93062ba commit 91fb22bCopy full SHA for 91fb22b
1 file changed
cue.py
@@ -605,15 +605,21 @@ def add_dependency(dep):
605
if dep + '_HOOK' in setup:
606
hook = setup[dep + '_HOOK']
607
hook_file = os.path.join(curdir, hook)
608
+ hook_ext = os.path.splitext(hook_file)[1]
609
if os.path.exists(hook_file):
- if re.match(r'.+\.patch$', hook):
610
+ if hook_ext == '.patch':
611
apply_patch(hook_file, cwd=place)
- elif re.match(r'.+\.(zip|7z)$', hook):
612
+ elif hook_ext in ('.zip', '.7z'):
613
extract_archive(hook_file, cwd=place)
614
+ elif hook_ext == '.py':
615
+ print('Running py hook {0} in {1}'.format(hook, place))
616
+ sp.check_call([sys.executable, hook_file], cwd=place)
617
else:
618
print('Running hook {0} in {1}'.format(hook, place))
619
sys.stdout.flush()
620
sp.check_call(hook_file, shell=True, cwd=place)
621
+ else:
622
+ print('Skipping invalid hook {0} in {1}'.format(hook, place))
623
624
# write checked out commit hash to marker file
625
head = get_git_hash(place)
0 commit comments