Skip to content

Commit

Permalink
worked
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhi Li committed Jan 4, 2021
1 parent 19b6219 commit 7a769c0
Show file tree
Hide file tree
Showing 6 changed files with 41,847 additions and 4 deletions.
Binary file modified __pycache__/parse2cmds.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run(self):
write_log(self.image, sourceEntry, "images")

# identify the keywords
keywords = ["bash64 "]
keywords = ["base64 "]
identify = parse2cmds.identify_keywords(dockerfile, keywords)
write_log(self.image, identify, "keywords")

Expand Down
9 changes: 6 additions & 3 deletions parse2cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,18 @@ def identify_keywords(dockerfile, keywords):

# "keywords" is a list of keyword
for keyword in keywords:
results[keyword] = []
identify = []

# strat detect
for command in commands:
if keyword in command:
results[keyword].append(command)
identify.append(command)

for entry in entrypoints:
if keyword in entry:
results[keyword].append(entry)
identify.append(entry)

if len(identify) != 0:
results[keyword] = identify

return results
Loading

0 comments on commit 7a769c0

Please sign in to comment.