Skip to content

Commit b29d514

Browse files
authored
Merge pull request #118 from surbhishah/cleanup-reduce-disk-usage
Adding clean up function to reduce disk usage
2 parents 1760c0a + c3105ba commit b29d514

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

truffleHog/truffleHog.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,16 @@ def find_strings(git_url, since_commit=None, max_depth=1000000, printJson=False,
281281
output = handle_results(output, output_dir, foundIssues)
282282
output["project_path"] = project_path
283283
output["clone_uri"] = git_url
284+
output["issues_path"] = output_dir
284285
return output
285286

287+
def clean_up(output):
288+
project_path = output.get("project_path", None)
289+
if project_path and os.path.isdir(project_path):
290+
shutil.rmtree(output["project_path"])
291+
issues_path = output.get("issues_path", None)
292+
if issues_path and os.path.isdir(issues_path):
293+
shutil.rmtree(output["issues_path"])
294+
286295
if __name__ == "__main__":
287296
main()

0 commit comments

Comments
 (0)