def get_vg_script(job, runner, script_name, work_dir):
"""
getting the path to a script in vg/scripts is different depending on if we're
in docker or not. wrap logic up here, where we get the script from wherever it
is then put it in the work_dir
"""
vg_container_type = runner.container_for_tool('vg')
if vg_container_type != 'None':
# we copy the scripts out of the container, assuming vg is at /vg
cmd = ['cp', os.path.join('/vg', 'scripts', script_name), '.']
runner.call(job, cmd, work_dir = work_dir, tool_name='vg')
else:
# we copy the script from the vg directory in our PATH
scripts_path = os.path.join(os.path.dirname(find_executable('vg')), '..', 'scripts')
shutil.copy2(os.path.join(scripts_path, script_name), os.path.join(work_dir, script_name))
return os.path.join(work_dir, script_name)
评论列表
文章目录