Skip to content

Commit

Permalink
Update instructions for blank-template and flat-template
Browse files Browse the repository at this point in the history
  • Loading branch information
James McKinney committed Nov 24, 2018
1 parent 96a17d1 commit fdc475d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 11 additions & 3 deletions blank-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd json-schema-random
npm install .
```

Then, run (in bash shell):
To regenerate all files, run (in bash shell):

```shell
for tag in `git -C ../standard tag | grep '1__\d__\d'`; do
Expand All @@ -24,13 +24,21 @@ done
git -C ../standard checkout 1.1-dev
```

Then, remove deprecated fields, by opening the `blank-template` directory in a text editor and using this regular expression to search deprecated fields and replace with empty strings:
To regenerate one file, set a `tag` environment variable and run:

```shell
git -C ../standard checkout $tag;
node cli.js ../standard/standard/schema/release-schema.json --no-random --no-additional > ../sample-data/blank-template/release-template-$tag.json
git -C ../standard checkout 1.1-dev
```

Remove deprecated fields by opening the `blank-template` directory in a text editor and using this regular expression to search deprecated fields and replace with empty strings:

```text
[,\n ]*"[a-zA-Z]+": "deprecated"
```

Finally, change into this repository's directory, and indent the files with two spaces:
Change into this repository's directory, and indent the files with two spaces:

```shell
pip install ocdskit
Expand Down
5 changes: 1 addition & 4 deletions flat-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ Feel free to hide or remove unused columns.

## Maintenance

Change into this repository's directory, and run:
This assumes that the `standard` repository and this repository have the same parent directory on your system, and that the `standard` repository is checked out to the latest tag. Install Flatten Tool, change into this repository's directory, and run:

```shell
pip install flatten-tool
git -C ../standard checkout 1__1__3
flatten-tool create-template --truncation-length 5 --schema=../standard/standard/schema/release-schema.json -o flat-template/template --root-id=ocid --main-sheet-name releases
git -C ../standard checkout 1.1-dev
```

0 comments on commit fdc475d

Please sign in to comment.