Fix "pmbootstrap log -c" crash (MR 2345)

Fixes #2387
This commit is contained in:
Anri Dellal 2024-07-03 11:05:12 +03:00 committed by HenriDellal
parent 67767b99ad
commit 8948594d74
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -23,7 +23,8 @@ class Log(commands.Command):
if self.clear_log:
run.user(["truncate", "-s", "0", context.log])
run.user(["truncate", "-s", "0", log_testsuite])
if log_testsuite.exists():
run.user(["truncate", "-s", "0", log_testsuite])
cmd: list[PathString] = ["tail", "-n", str(self.lines), "-F"]