Skip to content

Commit

Permalink
Manually deleting previous summary.txt file if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JCantu248 committed Aug 20, 2021
1 parent fa7b65b commit 6abc734
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/gophish_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import hashlib
import json
import logging
import os
import sys
from typing import Dict

Expand Down Expand Up @@ -271,6 +272,8 @@ def write_assessment_click_summary(api, assessment_id):
num_campaigns = len(campaign_ids)
json_filename = assessment_id + "_click_summary.json"
summary_outfile_name = assessment_id + "_click_summary.txt"
if os.path.exists(summary_outfile_name):
os.remove(summary_outfile_name)
fh = logging.FileHandler(summary_outfile_name, "w+")
logging.getLogger().addHandler(fh)
logging.info("-" * 50)
Expand Down

0 comments on commit 6abc734

Please sign in to comment.