Skip to content

Commit

Permalink
copy the mask file into the log folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphaltip committed Oct 24, 2023
1 parent b0422ac commit b2cb2e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions funannotate/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def __init__(self, prog):
# create log file for Repeats(capture stderr)
# make this filename unique so multiple mask runs can happen in same folder
log_name = "funannotate-mask." + str(uuid.uuid4())[-8:] + ".log"

# this next seems unncessary as filenames should be unique but will leave in
if os.path.isfile(log_name):
os.remove(log_name)
# initialize script, log system info and cmd issue at runtime
lib.setupLogging(log_name)
cmd_args = " ".join(sys.argv)+'\n'
Expand Down Expand Up @@ -195,7 +197,13 @@ def __init__(self, prog):
if tmpdir:
lib.SafeRemove(tmpdir)
print("-------------------------------------------------------")

if os.path.isfile(log_name):
if not os.path.isdir(os.path.join(outputdir, "logfiles")):
os.makedirs(os.path.join(outputdir, "logfiles"))
shutil.copyfile(
log_name, os.path.join(outputdir, "logfiles", "funannotate-mask.log")
)
os.remove(log_name)

if __name__ == "__main__":
main(sys.argv[1:])

0 comments on commit b2cb2e7

Please sign in to comment.