Skip to content

Commit

Permalink
Make yq work again for version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Mar 30, 2022
1 parent 30052fa commit 1caa5af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.7.4
2 changes: 1 addition & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
brew "coreutils"
brew "yq@3"
brew "yq"
brew "fswatch"
8 changes: 4 additions & 4 deletions _scripts/sh/create_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ _read_yaml() {

read_categories() {
local _yaml="$(_read_yaml "$1")"
local _categories="$(echo "$_yaml" | yq r - "categories.*")"
local _category="$(echo "$_yaml" | yq r - "category")"
local _categories="$(echo "$_yaml" | yq e ".categories | .." -)"
local _category="$(echo "$_yaml" | yq e ".category" -)"

if [[ -n $_categories ]]; then
echo "$_categories"
Expand All @@ -37,8 +37,8 @@ read_categories() {

read_tags() {
local _yaml="$(_read_yaml "$1")"
local _tags="$(echo "$_yaml" | yq r - "tags.*")"
local _tag="$(echo "$_yaml" | yq r - "tag")"
local _tags="$(echo "$_yaml" | yq e ".tags | .." -)"
local _tag="$(echo "$_yaml" | yq e ".tag" -)"

if [[ -n $_tags ]]; then
echo "$_tags"
Expand Down

0 comments on commit 1caa5af

Please sign in to comment.