88import subprocess
99import sys
1010import tempfile
11+ import re
1112
1213def quote_if_needed (row ):
1314 if row != "true" and row != "false" :
@@ -52,8 +53,8 @@ def printHelp(self):
5253 --with-sources
5354 --with-summaries
5455 --with-neutrals
55- --with-mixed-summaries (Experimental) . May not be used in conjunction with --with-summaries.
56- --with-mixed-neutrals (Experimental) . Should only be used in conjunction with --with-mixed-summaries.
56+ --with-mixed-summaries. May not be used in conjunction with --with-summaries.
57+ --with-mixed-neutrals. Should only be used in conjunction with --with-mixed-summaries.
5758 --with-typebased-summaries (Experimental)
5859If none of these flags are specified, all models are generated except for the type based models.
5960
@@ -65,7 +66,7 @@ def printHelp(self):
6566$ python3 GenerateFlowModel.py /tmp/dbs/my_library_db --with-sinks my_directory
6667
6768
68- Requirements: `codeql` should both appear on your path.
69+ Requirements: `codeql` should appear on your path.
6970 """ )
7071
7172
@@ -211,7 +212,9 @@ def save(self, extensions, extension):
211212extensions:
212213{0}"""
213214 for entry in extensions :
214- target = os .path .join (self .generatedFrameworks , entry + extension )
215+ # Replace problematic characters with dashes, and collapse multiple dashes.
216+ sanitizedEntry = re .sub (r'-+' , '-' , entry .replace ('/' , '-' ).replace (':' , '-' ))
217+ target = os .path .join (self .generatedFrameworks , sanitizedEntry + extension )
215218 with open (target , "w" ) as f :
216219 f .write (extensionTemplate .format (extensions [entry ]))
217220 print ("Models as data extensions written to " + target )
0 commit comments