Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change JAR file check #343

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ def determine_experiment_file_type(filepath: str):
filetype = ExperimentType.UNKNOWN
if 'Python script' in rawfiletype or 'python3' in rawfiletype:
filetype = ExperimentType.PYTHON
elif 'Zip archive data' in rawfiletype:
# check for META-INF/MANIFEST.MF in file
elif 'ELF 64-bit LSB' in rawfiletype:
filetype = ExperimentType.C
else:
# check if it is a jar file, they can have multiple rawfiletypes
try:
file = open(filepath, "r")
contents = file.read()
Expand All @@ -184,8 +186,6 @@ def determine_experiment_file_type(filepath: str):
except FileNotFoundError as e:
explogger.error(f"{filepath} could not be read to determine if it is a jar file!")
raise e
elif 'ELF 64-bit LSB' in rawfiletype:
filetype = ExperimentType.C

explogger.info(f"Raw Filetype: {rawfiletype}\n Filtered Filetype: {filetype.value}")

Expand Down
Loading