Newer
Older

Malte Nyhuis
committed
import os
import shutil
"""
copies (part of) a workflow to a destination
"""

Malte Nyhuis
committed
import ntrfc
assert os.path.isdir(dest), "destination is not a direcotry"
assert len(os.listdir(dest)) == 0, "destination is not empty"

Malte Nyhuis
committed
src_dir = os.path.abspath(os.path.dirname(ntrfc.__file__))
smk_dir = os.path.join(src_dir, "..", "workflows")
wkf_dir = os.path.join(smk_dir, workflow_name)
shutil.copytree(wkf_dir, dest, dirs_exist_ok=True)