-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 export v2: Automatically minify output
Automatically format the output JSON file based on the number of tips, unless either --minify-json or --no-minify-json (new option) is specified.
- Loading branch information
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Tree with a few nodes is not automatically minified. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --output output.json &>/dev/null | ||
|
||
$ head -c 20 output.json | ||
{ | ||
"version": "v2", (no-eol) | ||
|
||
It can be forcefully minified with an argument. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --minify-json \ | ||
> --output output.json &>/dev/null | ||
|
||
$ head -c 20 output.json | ||
{"version": "v2", "m (no-eol) | ||
Tree with many nodes is automatically minified. | ||
FIXME: find a tree with >1000 nodes for testing here. | ||
It can be forcefully not minified with an argument. | ||
FIXME: add test for --no-minify-json. |