mkdir with proper owner

- using sudo only when not in user account
+ fix typo
This commit is contained in:
2025-05-08 14:52:47 +02:00
parent f41b76633b
commit 30369aff3c

View File

@ -468,9 +468,10 @@ class Show(Walker):
class Do(Walker): class Do(Walker):
def newer(self, files): def newer(self, files):
unix_cmd('mkdir', '-p', str(self.sysypath)) usesudo = not self.syspath.is_relative_to(Path.home())
unix_cmd('mkdir', '-p', str(self.syspath), sudo=usesudo)
unix_cmd('cp', *(str(self.dirpath / f) for f in files), str(self.syspath), unix_cmd('cp', *(str(self.dirpath / f) for f in files), str(self.syspath),
sudo=not self.syspath.is_relative_to(Path.home())) sudo=usesudo)
older = newer older = newer