3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-06 14:24:08 +00:00

Add support for directories in [files] section

Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
This commit is contained in:
Claire Xenia Wolf 2021-10-31 14:43:02 +01:00
parent 1b3832cf92
commit 5d19e4641a

View file

@ -20,7 +20,7 @@ import os, re, sys, signal
if os.name == "posix": if os.name == "posix":
import resource, fcntl import resource, fcntl
import subprocess import subprocess
from shutil import copyfile, rmtree from shutil import copyfile, copytree, rmtree
from select import select from select import select
from time import time, localtime, sleep from time import time, localtime, sleep
@ -332,7 +332,10 @@ class SbyJob:
os.makedirs(basedir) os.makedirs(basedir)
self.log(f"Copy '{os.path.abspath(srcfile)}' to '{os.path.abspath(dstfile)}'.") self.log(f"Copy '{os.path.abspath(srcfile)}' to '{os.path.abspath(dstfile)}'.")
copyfile(srcfile, dstfile) if os.path.isdir(srcfile):
copytree(srcfile, dstfile, dirs_exist_ok=True)
else:
copyfile(srcfile, dstfile)
def handle_str_option(self, option_name, default_value): def handle_str_option(self, option_name, default_value):
if option_name in self.options: if option_name in self.options: