From fdc475d47b8a7967623a1ea60da91a6b26fea89e Mon Sep 17 00:00:00 2001 From: James McKinney Date: Fri, 23 Nov 2018 22:00:22 -0500 Subject: [PATCH] Update instructions for blank-template and flat-template --- blank-template/README.md | 14 +++++++++++--- flat-template/README.md | 5 +---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/blank-template/README.md b/blank-template/README.md index 9bd7f5a..ddbb63f 100644 --- a/blank-template/README.md +++ b/blank-template/README.md @@ -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 @@ -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 diff --git a/flat-template/README.md b/flat-template/README.md index e45bf60..b7ab218 100644 --- a/flat-template/README.md +++ b/flat-template/README.md @@ -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 ```