Skip to content

Commit e7775ac

Browse files
committed
Changed outputs default value to "./output"
1 parent 248c721 commit e7775ac

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ssri/ssri.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ def getListOfFilesToSearchFiles(
113113
lastGoodFile = files
114114
filePathOut = outputDir[0] + "/" + str(files)
115115
if os.path.exists(filePathOut) and noWarnings == False and safeMode == False:
116+
if filePathOut.strip("./") in inputFile:
117+
print(
118+
f"{CRED}You are about to overwrite your input file: {filePathOut}, exiting{CEND}"
119+
)
120+
exit()
116121
print(
117122
f"{CRED}Warning, you are about to overwrite {filePathOut}, do you want to continue (if you did not intend to do please look at the -o option)? y/N{CEND}"
118123
)
@@ -144,7 +149,8 @@ def getListOfFilesToSearchFiles(
144149
outputDir[0] + "/" + str(files) + ".ssri"
145150
) # Prevent overwriting exisiting files
146151
else:
147-
print(re.findall(r"([^\/]+$)", str(files)))
152+
verboseMsg = "filename(s) are " + str(re.findall(r"([^\/]+$)", str(files)))
153+
verbosePrint(verbose, verboseMsg)
148154
filesToSearch[1].append(
149155
outputDir[0] + "/" + re.findall(r"([^\/]+$)", str(files))[0]
150156
)
@@ -301,7 +307,7 @@ def parse_args(args):
301307
parser.add_argument(
302308
"-o",
303309
"--output",
304-
default=".",
310+
default=["./output"],
305311
nargs=1,
306312
type=str,
307313
help="the directory for output files to be placed (default is current directory)",

0 commit comments

Comments
 (0)