Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-04-28 14:20:12 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-04-28 14:20:12 +0200
commita13db6bffd93d317c4acb27ef60dfe25a2301979 (patch)
tree383799556d165568371c77ee5f55fa5bfc8378f2 /archinstall/lib
parent58d933e150999aea0625623027935ca0c89558b5 (diff)
Fixing permission error on non-root-runners accessing log()
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/output.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
index 73819422..6a294f40 100644
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -110,6 +110,8 @@ def log(*args, **kwargs):
if not os.path.isfile(absolute_logfile):
try:
Path(absolute_logfile).parents[0].mkdir(exist_ok=True, parents=True)
+ with open(absolute_logfile, 'a') as log_file:
+ log_file.write("")
except PermissionError:
# Fallback to creating the log file in the current folder
err_string = f"Not enough permission to place log file at {absolute_logfile}, creating it in {Path('./').absolute()/filename} instead."