aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/initialize.py4
-rw-r--r--scripts/utils.py10
2 files changed, 6 insertions, 8 deletions
diff --git a/scripts/initialize.py b/scripts/initialize.py
index 96ba0b0..36da24d 100755
--- a/scripts/initialize.py
+++ b/scripts/initialize.py
@@ -26,7 +26,9 @@ def all():
def base():
print('Initialize base...')
- try: os.mkdir(sf(conf.build_folder))
+ try:
+ os.mkdir(sf(conf.build_folder))
+ os.mkdir(sf(conf.log_folder))
except FileExistsError:
pass
diff --git a/scripts/utils.py b/scripts/utils.py
index 9c83065..0d7f67a 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -57,16 +57,12 @@ def build_conf_map():
def callsubprocess(process_name, process, show_output = True, regular = "",
env=os.environ):
- try:
- os.mkdir(sf(conf.log_folder))
- except OSError:
- pass
-
sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env)
rtn = ""
- with open(os.path.join(sf(conf.log_folder), process_name + ".log"), "a") as f:
- f.write("::" + time.strftime("%y-%m-%d-%H-%M-%S") + "::\n")
+ with open(os.path.join(sf(conf.log_folder),
+ process_name + '-' + time.strftime("%y-%m-%d-%H-%M-%S") + ".log"),
+ "w") as f:
for linen in sprc.stdout:
line = linen.decode(sys.getdefaultencoding())
f.write(line)