Skip to content

Commit

Permalink
update check for jar file
Browse files Browse the repository at this point in the history
  • Loading branch information
rhit-windsors committed Oct 29, 2024
1 parent 96c44c1 commit d54384e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,16 @@ def determine_experiment_file_type(filepath: str):
filetype = ExperimentType.UNKNOWN
if 'Python script' in rawfiletype or 'python3' in rawfiletype:
filetype = ExperimentType.PYTHON
elif 'Java archive data (JAR)' in rawfiletype:
filetype = ExperimentType.JAVA
elif 'Zip archive data' in rawfiletype:
# check for META-INF/MANIFEST.MF in file
try:
file = open(filepath, "r")
contents = file.read()
if "META-INF/MANIFEST.MF" in contents:
filetype = ExperimentType.JAVA
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

Expand Down

0 comments on commit d54384e

Please sign in to comment.