coreos / fedora-coreos-docs

Documentation for Fedora CoreOS
https://docs.fedoraproject.org/en-US/fedora-coreos/
Other
49 stars 119 forks source link

Fixes arguments to the jq command #628

Closed DuncanConroy closed 2 months ago

DuncanConroy commented 2 months ago

sets arguments to jq in single quotes to fix syntax

dustymabe commented 2 months ago

What exactly is the problem? Seems to work fine here:

[dustymabe@hattop ~]$ RELEASE=$(curl https://builds.coreos.fedoraproject.org/prod/streams/stable/releases.json | jq -r .releases[-2].version)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 45439  100 45439    0     0  58990      0 --:--:-- --:--:-- --:--:-- 59011
[dustymabe@hattop ~]$ echo $RELEASE 
39.20240322.3.0
DuncanConroy commented 2 months ago

interesting! maybe it's because I'm on zsh. I get this:

RELEASE=$(curl https://builds.coreos.fedoraproject.org/prod/streams/stable/releases.json | jq -r .releases[-2].version)

zsh: no matches found: .releases[-2].version
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 35 45439   35 16009    0     0  50708      0 --:--:-- --:--:-- --:--:-- 50822
curl: (23) Failure writing output to destination

If I download the file and run

cat releases.json| jq -r .releases[-2].version
zsh: no matches found: .releases[-2].version

While if I set it in single quotes, it works:

cat releases.json| jq -r '.releases[-2].version'
39.20240322.3.0
dustymabe commented 2 months ago

ok. just update the commit message body to mention fix syntax on zsh

DuncanConroy commented 2 months ago

that's done, thanks!