Skip to content
Snippets Groups Projects
Commit c0cf4dae authored by Fawwaz Anugrah Wiradhika Dharmasatya's avatar Fawwaz Anugrah Wiradhika Dharmasatya
Browse files

feat: support execution in linux

parent f341a178
Branches
No related merge requests found
......@@ -8,7 +8,7 @@ cd src/lib
./src/lib/joern/joern --script src/lib/scripts/gen_cfg.sc --param """codeFiles=FileParser.py"""
```
## Note
For now only work on Linux (Windows command is mucho different)
For now only testes in windows and linux
Regex to find uncommented print statement
```sh
......
......@@ -4,6 +4,7 @@ from lib.utils import format_log
from typing import Optional
from lib.CFGGenerator import CFGGenerator,CFG
from lib.custom_class import ElementContext
from sys import platform
class FileReader:
ANNOTATION_PATTERN = "\S*@.+"
def __init__(self, project_path:str)->None:
......@@ -152,7 +153,11 @@ class FileReader:
for root, dirs, files in os.walk(self.project_path):
for file in files:
if(self.is_source_code_supported(file)):
file_list.append(f"{root}\\{file}")
if platform.startswith("win"):
# Windows use \ to separate
file_list.append(f"{root}\\{file}")
else:
file_list.append(f"{root}/{file}")
return file_list
def is_source_code_supported(self,filename:str)->bool:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment