Always append to log files.

This commit is contained in:
Alexis Métaireau 2016-06-20 18:55:59 +02:00
parent df2d0ccada
commit 6c1f22ae96
No known key found for this signature in database
GPG key ID: 1EDF5A7A485D4A11

View file

@ -6,7 +6,7 @@ import subprocess
def spawn(cmd, logfile=None):
"""Quick shortcut to spawn a command on the filesystem"""
if logfile is not None:
with open(logfile, "w") as f:
with open(logfile, "a+") as f:
prepared_cmd = shlex.split("stdbuf -o0 %s" % cmd)
process = subprocess.Popen(prepared_cmd, stdout=f)
else: