|
|
@ -110,7 +110,7 @@ def run_install_script(d): |
|
|
|
print('Running custom install script %s' % script) |
|
|
|
print('Running custom install script %s' % script) |
|
|
|
suffix = os.path.splitext(script)[1].lower() |
|
|
|
suffix = os.path.splitext(script)[1].lower() |
|
|
|
if platform.system().lower() == 'windows' and suffix != '.bat': |
|
|
|
if platform.system().lower() == 'windows' and suffix != '.bat': |
|
|
|
first_line = open(script).readline().strip() |
|
|
|
first_line = open(script, encoding='latin_1', errors='ignore').readline().strip() |
|
|
|
if first_line.startswith('#!'): |
|
|
|
if first_line.startswith('#!'): |
|
|
|
if shutil.which(first_line[2:]): |
|
|
|
if shutil.which(first_line[2:]): |
|
|
|
commands = [first_line[2:]] |
|
|
|
commands = [first_line[2:]] |
|
|
@ -118,7 +118,6 @@ def run_install_script(d): |
|
|
|
commands = first_line[2:].split('#')[0].strip().split() |
|
|
|
commands = first_line[2:].split('#')[0].strip().split() |
|
|
|
commands[0] = shutil.which(commands[0].split('/')[-1]) |
|
|
|
commands[0] = shutil.which(commands[0].split('/')[-1]) |
|
|
|
if commands[0] is None: |
|
|
|
if commands[0] is None: |
|
|
|
commands |
|
|
|
|
|
|
|
raise RuntimeError("Don't know how to run script %s." % script) |
|
|
|
raise RuntimeError("Don't know how to run script %s." % script) |
|
|
|
final_command = commands + [script] + i.cmd_arr[1:] |
|
|
|
final_command = commands + [script] + i.cmd_arr[1:] |
|
|
|
else: |
|
|
|
else: |
|
|
|