def copy_cwl_files(from_dir=CWL_PATH):
"""Copy cwl files to a directory where the cwl-runner can find them.
cwl files are copied to $XDG_DATA_HOME/commonwl/ This is one of the default
locations where the cwl-runner looks for cwl files.
Args:
from_dir (str): Path to directory where to copy files from (default:
the cwl directory of nlppln).
"""
cwl_data_dir = os.environ.get('XDG_DATA_HOME')
if not cwl_data_dir:
cwl_data_dir = DEFAULT_DATA_DIR
cwl_data_dir = os.path.join(cwl_data_dir, CWL_DATA_DIR_PREFIX)
create_dirs(cwl_data_dir)
cwl_files = glob.glob('{}{}*.cwl'.format(from_dir, os.sep))
for fi in cwl_files:
fo = os.path.join(cwl_data_dir, os.path.basename(fi))
shutil.copy2(fi, fo)
评论列表
文章目录