Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to add files to galaxy tool #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion odabot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import traceback
import xml.etree.ElementTree as ET
from glob import glob

import click
from dynaconf import Dynaconf
Expand Down Expand Up @@ -908,7 +909,26 @@ def repo_file_path_if_available(filename):

with open(os.path.join(outd, '.shed.yml'), 'wt') as fd:
yaml.dump(shed_content, fd)


if help_file is not None:
fm = frontmatter.load(help_file)
if fm.get('additional_files', None):
globlist = fm['additional_files']
if isinstance(globlist, str):
globlist = [ globlist ]
elif isinstance(globlist, list):
pass
else:
raise ValueError("Wrong specification of additional files")

for fileglob in globlist:
addfiles = glob(fileglob, root_dir=wf_repo_dir, recursive=True)
for fp in addfiles:
shutil.copyfile(
os.path.join(wf_repo_dir, fp),
os.path.join(outd, fp)
)


logger.info("Git status:\n" + sp.check_output(['git', 'status'], text=True))

Expand Down
Loading