Skip to content

Commit

Permalink
Added support for single quotation marks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebagabones committed Jan 2, 2025
1 parent 11fdd9e commit 248c721
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ssri/ssri.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ def checkFilesForIncludes(
[],
[],
) # first list is text found, second is the text to replace it with

# print(re.findall(r'<!--.*#include file=".+".*-->', fileRead.read()))
for line in fileReadIn:
includeFiles[0].extend(re.findall(r'<!--.*#include file=".+".*-->', line))
includeFiles[0].extend(re.findall(r'<!--.*#include file=["|\'].+["|\'].*-->', line)) # Now it shouldn't matter if someone uses " or ' (but why you not use " idk)
fileRead.close()

if len(includeFiles[0]) != 0:
verboseMsg = f"{fileName} has match(es) with {includeFiles[0]}"
verbosePrint(verbose, verboseMsg)
# copyOfInitialIncludesFile = includeFiles[0].copy()
for matchReg in includeFiles[0]:
fileToRead = re.search(r'"(.+)"', matchReg).group().strip('"')
fileToRead = re.search(r'["\'](.+)["\']', matchReg).group().strip('"').strip("'")
fullPathOfInclude = templateDir + "/" + fileToRead
verboseMsg = (
f"Will attempt to be reading in in file: {fullPathOfInclude}"
Expand Down

0 comments on commit 248c721

Please sign in to comment.