Skip to content

Commit f60daaf

Browse files
committed
Choose correct ingen when shell and normal ingen is present
1 parent 9dfd137 commit f60daaf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/sinol_make/commands/gen/gen_util.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ def get_ingen(task_id=None, ingen_path=None):
4242
util.exit_with_error(f'Ingen source file for task {task_id} does not exist.')
4343

4444
# Sio2 first chooses shell scripts, then non-shell source codes.
45-
if os.path.splitext(ingen[0])[1] == '.sh' and len(ingen) > 1:
46-
return ingen[1]
47-
else:
48-
return ingen[0]
45+
correct_ingen = None
46+
for i in ingen:
47+
if os.path.splitext(i)[1] == '.sh':
48+
correct_ingen = i
49+
break
50+
if correct_ingen is None:
51+
correct_ingen = ingen[0]
52+
return correct_ingen
4953

5054

5155
def compile_ingen(ingen_path: str, args: argparse.Namespace, weak_compilation_flags=False):

0 commit comments

Comments
 (0)