From 96955ffa9c670f1d5d448a1761f34629d91cc999 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sat, 11 Jan 2020 09:55:24 +1100 Subject: [PATCH] release notes --- Upgrade Notes | 40 +++++++++++++++++++++++--------- examples/instruction_sample.yaml | 3 --- scripts/publish.sh | 2 +- scripts/xcompile.sh | 4 ++-- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Upgrade Notes b/Upgrade Notes index 9f2eecdf..bdd8f99a 100644 --- a/Upgrade Notes +++ b/Upgrade Notes @@ -1,12 +1,14 @@ +Major release! Upgraded underlying yaml parser, re-written majority of yq. This has brought on a number of features that have been in demand for a while (see below). + +This is in beta and needs some community feedback and testing :) + # New Features - - Keeps yaml comments and formatting (string blocks are saved, number formatting is preserved, so it won't drop off trailing 0s for values like 0.10, which is important when that's a version entry ) - - - Handles anchors! (doc link) - - Can specify yaml tags (e.g. !!int), quoting values no longer sufficient, need to specify the tag value instead. - - Can print out matching paths and values when splatting (doc link) + - Keeps yaml comments and formatting, can specify yaml tags when updating. https://github.com/mikefarah/yq/issues/19, https://github.com/mikefarah/yq/issues/169, https://github.com/mikefarah/yq/issues/107, https://github.com/mikefarah/yq/issues/171, https://github.com/mikefarah/yq/issues/245, https://github.com/mikefarah/yq/issues/303,https://github.com/mikefarah/yq/issues/308,https://github.com/mikefarah/yq/issues/314 + - Handles anchors! https://github.com/mikefarah/yq/issues/310, https://github.com/mikefarah/yq/issues/178 + - Can print out matching paths and values when splatting https://github.com/mikefarah/yq/issues/20 - JSON output works for all commands! Yaml files with multiple documents are printed out as one JSON document per line. - - Deep splat (**) to match arbitrary paths, (doc link) + - Deep splat (**) to match arbitrary paths # Breaking changes @@ -14,6 +16,24 @@ ## Update scripts file format has changed to be more powerful. Comments can be added, and delete commands have been introduced. +Before: +```yaml +b.e[+].name: Mike Farah +``` + +After: +```yaml +- command: update + path: b.e[+].thing + value: + #great + things: frog # wow! +- command: delete + path: b.d +``` + +https://github.com/mikefarah/yq/issues/305 + ## Reading and splatting, matching results are printed once per line. e.g: @@ -27,7 +47,9 @@ parent: there2: also matches ``` +```bash yq r sample.yaml 'parent.*.there*' +``` old ```yaml @@ -49,8 +71,4 @@ yq r --printMode pv sample.yaml 'parent.*.there*' ```yaml parent.childB.there: matches parent.childB.there2: also matches -``` - -# Merge command -- New flag 'autocreates' missing entries in target by default, new flag to turn that off. - +``` \ No newline at end of file diff --git a/examples/instruction_sample.yaml b/examples/instruction_sample.yaml index d531a302..652e0228 100644 --- a/examples/instruction_sample.yaml +++ b/examples/instruction_sample.yaml @@ -3,8 +3,5 @@ value: #great things: frog # wow! -- command: update - path: b.e[+].name - value: Mike Farah - command: delete path: b.d \ No newline at end of file diff --git a/scripts/publish.sh b/scripts/publish.sh index c878481e..40b290f6 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -32,5 +32,5 @@ upload() { done < <(find ./build -mindepth 1 -maxdepth 1 -print0) } -release +# release upload diff --git a/scripts/xcompile.sh b/scripts/xcompile.sh index 29d30f2a..1ecc2bfb 100755 --- a/scripts/xcompile.sh +++ b/scripts/xcompile.sh @@ -3,7 +3,7 @@ # This assumes that gonative and gox is installed as per the 'one time setup' instructions # at https://github.com/inconshreveable/gonative -gox -ldflags "${LDFLAGS}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" +gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}" # include non-default linux builds too -gox -ldflags "${LDFLAGS}" -os=linux -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" +gox -ldflags "${LDFLAGS}" -os=linux -output="build/yq_{{.OS}}_{{.Arch}}"