Skip to content

Commit aeeeb48

Browse files
bobheadxiLawnGnome
andauthored
config: fix subjects flag, add example for editing global config (#413)
Co-authored-by: Adam Harvey <[email protected]>
1 parent df9af29 commit aeeeb48

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ All notable changes to `src-cli` are documented in this file.
1919

2020
### Fixed
2121

22+
- `src config` now works correctly when provided a subject.
23+
2224
### Removed
2325

2426
## 3.23.1

cmd/src/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ query SettingsSubjectLatestSettingsID($subject: ID!) {
158158
}
159159
}
160160

161-
if _, err := client.NewQuery(query).Do(ctx, &result); err != nil {
161+
if _, err := client.NewRequest(query, map[string]interface{}{
162+
"subject": subjectID,
163+
}).Do(ctx, &result); err != nil {
162164
return nil, err
163165
}
164166

cmd/src/config_edit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Examples:
3434
3535
$ src config edit -subject=$(src orgs get -f '{{.ID}}' -name=abc-org) -overwrite -value '{"motd":["Hello!"]}'
3636
37+
Change global settings:
38+
39+
$ src config edit -subject=$(echo 'query { site { id } }' | src api | jq .data.site.id --raw-output)
3740
`
3841

3942
flagSet := flag.NewFlagSet("edit", flag.ExitOnError)

0 commit comments

Comments
 (0)