make dir if needed

This commit is contained in:
2025-05-08 14:50:27 +02:00
parent c4f2665b98
commit f41b76633b

View File

@ -19,7 +19,7 @@ import tempfile
from pathlib import Path from pathlib import Path
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from ipaddress import IPv4Interface from ipaddress import IPv4Interface
from os.path import getmtime from os.path import getmtime, exists
from gitea import change_to_gitea from gitea import change_to_gitea
@ -468,6 +468,7 @@ class Show(Walker):
class Do(Walker): class Do(Walker):
def newer(self, files): def newer(self, files):
unix_cmd('mkdir', '-p', str(self.sysypath))
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=not self.syspath.is_relative_to(Path.home()))