Skip to content

Commit

Permalink
Merge pull request #53 from nextflow-io/nvnieuwk-patch-1
Browse files Browse the repository at this point in the history
Fix small issues in the migration commands
  • Loading branch information
nvnieuwk authored Sep 19, 2024
2 parents b5e6370 + aa5af6c commit c3eac9d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,23 @@ The name and the version of the plugin should be updated from `nf-validation` to
Additionally, all includes from `nf-validation` should be updated to `nf-schema`. This can easily be done with the following command:

```bash
find . -type f -name "*.nf" -exec sed -i -e "s/from 'plugin\/nf-validation'/from 'plugin\/nf-schema'/g" -
e 's/from "plugin\/nf-validation"/from "plugin\/nf-schema"/g' {} +
find . -type f -name "*.nf" -exec sed -i -e "s/from 'plugin\/nf-validation'/from 'plugin\/nf-schema'/g" -e 's/from "plugin\/nf-validation"/from "plugin\/nf-schema"/g' {} +
```

### Updating the JSON schema files

If you aren't using any special features in your schemas, you can simply update your `nextflow_schema.json` file using the following command:

```bash
sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/$defs/g' nextflow_schema.json
sed -i -e 's/https?:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/$defs/g' nextflow_schema.json
```

This will replace the old schema draft specification (`draft-07`) by the new one (`2020-12`), and the old keyword `definitions` by the new notation `$defs`.

!!! note

Repeat this command for every JSON schema used in your pipeline. e.g. for the default samplesheet schema in nf-core pipelines:
`bash sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/$defs/g' assets/schema_input.json`
`bash sed -i -e 's/https?:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/$defs/g' assets/schema_input.json`

!!! warning

Expand Down

0 comments on commit c3eac9d

Please sign in to comment.