Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# nf-core/tools: Changelog

## v1.7dev

#### Syncing
* Can now sync a targeted pipeline via command-line

## v1.6

#### Syncing
Expand Down
8 changes: 6 additions & 2 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def filter_blacklisted_pipelines_from_list(pipelines, blacklisted_pipelines):
def fetch_black_listed_pipelines_from_file(file_path):
with open(file_path) as fh:
blacklist = json.load(fh)
return blacklist
return blacklist.get('pipelines')


def fetch_nfcore_workflows_from_website(url):
Expand Down Expand Up @@ -100,7 +100,11 @@ def main():

pipelines = fetch_nfcore_workflows_from_website(NF_CORE_PIPELINE_INFO)

filtered_pipelines = filter_blacklisted_pipelines_from_list(pipelines, blacklisted_pipeline_names)
if len(sys.argv) > 1:
pipeline_to_sync = sys.argv[1]
filtered_pipelines = [pipeline for pipeline in pipelines if pipeline_to_sync in pipeline.get('name')]
else:
filtered_pipelines = filter_blacklisted_pipelines_from_list(pipelines, blacklisted_pipeline_names)

for pipeline in filtered_pipelines:
print("Update template branch for pipeline '{pipeline}'... ".format(pipeline=pipeline['name']))
Expand Down
6 changes: 2 additions & 4 deletions bin/syncutils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def context_from_nextflow(self, nf_project_dir):
Returns: A cookiecutter-readable context (Python dictionary)
"""
# Check if we are on "master" (main pipeline code)
if self.repo.active_branch.name != "master":
self.repo.git.checkout("origin/master", b="master")
if self.repo.active_branch.name != "dev":
self.repo.git.checkout("origin/dev", b="dev")

# Fetch the config variables from the Nextflow pipeline
config = utils.fetch_wf_config(wf_path=nf_project_dir)
Expand All @@ -66,8 +66,6 @@ def update_child_template(self, templatedir, target_dir, context=None):
shutil.rmtree(os.path.join(target_dir, f))
except:
os.remove(os.path.join(target_dir, f))
print(target_dir)
print(context.get('author'))
# Create the new template structure
nf_core.create.PipelineCreate(
name=context.get('pipeline_name'),
Expand Down