hash
stringlengths
40
40
date
stringdate
2019-01-29 11:49:07
2025-03-22 03:23:55
author
stringclasses
79 values
commit_message
stringlengths
14
85
is_merge
bool
1 class
git_diff
stringlengths
210
1.63M
type
stringclasses
8 values
masked_commit_message
stringlengths
8
79
4e35c80cd6249607e3ff04e74cb65bef4f467183
2023-01-27 02:40:41
Tom Payne
docs: Add dedicated social media page
false
diff --git a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl b/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl index bc3b9ff9db2..27eda7ff169 100644 --- a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl +++ b/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl @@ -12,13 +12,6 @@ Recommended podcast: [Managing Dot Files and an Introduction to Chezmoi](https://www.podfeet.com/blog/2021/07/ccatp-693/) -See mentions of [`chezmoi.io` on -Twitter](https://twitter.com/search?q=chezmoi.io), [`chezmoi dotfiles` on -Twitter](https://twitter.com/search?q=chezmoi+dotfiles), [comments mentioning -`chezmoi` on Hacker -News](https://hn.algolia.com/?query=chezmoi&sort=byPopularity&type=comment), -and [`chezmoi` on Reddit](https://www.reddit.com/search/?q=chezmoi). - | Date | Version | Format | Link | | ---- | ------- | ------ | ---- | {{- range mustReverse .articles }} diff --git a/assets/chezmoi.io/docs/links/social-media.md b/assets/chezmoi.io/docs/links/social-media.md new file mode 100644 index 00000000000..0d3ef1bdbaf --- /dev/null +++ b/assets/chezmoi.io/docs/links/social-media.md @@ -0,0 +1,11 @@ +# Social media + +| Platform | Search term | +| ----------- | -------------------------------------------------------------------------------------------------------------------------- | +| Hacker News | [`chezmoi`](https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=chezmoi&sort=byDate&type=comment) | +| LinkedIn | [`chezmoi dotfiles`](https://www.linkedin.com/search/results/all/?keywords=chezmoi%20dotfiles&origin=GLOBAL_SEARCH_HEADER) | +| Reddit | [`chezmoi`](https://www.reddit.com/search/?q=chezmoi&sort=new) | +| Twitter | [`chezmoi dotfiles`](https://twitter.com/search?q=chezmoi%20dotfiles&f=live) | +| Twitter | [`chezmoi.io`](https://twitter.com/search?q=chezmoi.io&f=live) | +| YouTube | [`chezmoi dotfiles`](https://www.youtube.com/results?search_query=chezmoi+dotfiles) | + diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 1976e5d60e4..e3f45e588dc 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -281,6 +281,7 @@ nav: - Articles, podcasts, and videos: links/articles-podcasts-and-videos.md - Dotfile repos using chezmoi: links/dotfile-repos-using-chezmoi.md - Related software: links/related-software.md + - Social media: links/social-media.md - License: license.md markdown_extensions:
docs
Add dedicated social media page
a9b268c29172702952ca1118651eb2dc69f763dc
2022-10-05 19:06:48
Tom Payne
chore: Build with Go 1.19.2
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5543348d29d..e52434d7579 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: - v* env: AGE_VERSION: 1.0.0 - GO_VERSION: 1.19.1 + GO_VERSION: 1.19.2 GOFUMPT_VERSION: 0.4.0 GOLANGCI_LINT_VERSION: 1.49.0 TPARSE_VERSION: 0.11.1
chore
Build with Go 1.19.2
2606249b9ac47d0b752aaa8c202d5eac8061f833
2021-01-23 01:05:56
dependabot[bot]
build(deps): bump github.com/zalando/go-keyring from 0.1.0 to 0.1.1
false
diff --git a/go.mod b/go.mod index a01e7176e86..e4b347ee93e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/bmatcuk/doublestar/v3 v3.0.0 github.com/charmbracelet/glamour v0.2.1-0.20201227140546-4292a2106d74 github.com/coreos/go-semver v0.3.0 - github.com/danieljoos/wincred v1.1.0 // indirect github.com/dlclark/regexp2 v1.4.0 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/go-git/go-git/v5 v5.2.0 @@ -44,7 +43,7 @@ require ( github.com/twpayne/go-vfsafero v1.0.0 github.com/twpayne/go-xdg/v3 v3.1.0 github.com/xanzy/ssh-agent v0.3.0 // indirect - github.com/zalando/go-keyring v0.1.0 + github.com/zalando/go-keyring v0.1.1 go.etcd.io/bbolt v1.3.5 go.uber.org/multierr v1.6.0 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect diff --git a/go.sum b/go.sum index 0bc95de106c..61bd4d2adc5 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,6 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g= github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= @@ -144,8 +142,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4= -github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -450,8 +448,8 @@ github.com/yuin/goldmark v1.3.1 h1:eVwehsLsZlCJCwXyGLgg+Q4iFWE/eTIMG0e8waCmm/I= github.com/yuin/goldmark v1.3.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= -github.com/zalando/go-keyring v0.1.0 h1:ffq972Aoa4iHNzBlUHgK5Y+k8+r/8GvcGd80/OFZb/k= -github.com/zalando/go-keyring v0.1.0/go.mod h1:RaxNwUITJaHVdQ0VC7pELPZ3tOWn13nr0gZMZEhpVU0= +github.com/zalando/go-keyring v0.1.1 h1:w2V9lcx/Uj4l+dzAf1m9s+DJ1O8ROkEHnynonHjTcYE= +github.com/zalando/go-keyring v0.1.1/go.mod h1:OIC+OZ28XbmwFxU/Rp9V7eKzZjamBJwRzC8UFJH9+L8= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
build
bump github.com/zalando/go-keyring from 0.1.0 to 0.1.1
f262a035119f6356bc23bbe8b1eeb9776fa9dd16
2021-10-02 21:07:58
Tom Payne
chore: Improve Vagrant test scripts
false
diff --git a/assets/vagrant/freebsd13.test-chezmoi.sh b/assets/vagrant/freebsd13.test-chezmoi.sh old mode 100644 new mode 100755 index ffeef72de3c..a27de7948e0 --- a/assets/vagrant/freebsd13.test-chezmoi.sh +++ b/assets/vagrant/freebsd13.test-chezmoi.sh @@ -1,3 +1,5 @@ -#!/bin/sh +#!/bin/bash + +set -eufo pipefail ( cd /chezmoi && go test ./... ) diff --git a/assets/vagrant/openbsd6.test-chezmoi.sh b/assets/vagrant/openbsd6.test-chezmoi.sh old mode 100644 new mode 100755 index ffeef72de3c..a27de7948e0 --- a/assets/vagrant/openbsd6.test-chezmoi.sh +++ b/assets/vagrant/openbsd6.test-chezmoi.sh @@ -1,3 +1,5 @@ -#!/bin/sh +#!/bin/bash + +set -eufo pipefail ( cd /chezmoi && go test ./... ) diff --git a/assets/vagrant/test.sh b/assets/vagrant/test.sh index ac4f3040f68..d5a995960ac 100755 --- a/assets/vagrant/test.sh +++ b/assets/vagrant/test.sh @@ -11,7 +11,7 @@ for os in "$@"; do if ! ( cd ../.. && vagrant up ); then exit 1 fi - vagrant ssh -c "sh test-chezmoi.sh" + vagrant ssh -c "./test-chezmoi.sh" vagrant_ssh_exit_code=$? vagrant destroy -f || exit 1 if [ $vagrant_ssh_exit_code -ne 0 ]; then
chore
Improve Vagrant test scripts
84a52ed1dc385fbfcb999a9eddeb0053c5da8195
2022-04-01 21:29:34
dependabot[bot]
chore(deps): bump actions/checkout from 2 to 3
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 418e42c1c83..1bf12d5b97e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: build-website: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install-website-dependencies run: | pip3 install mkdocs-material mkdocs-mermaid2-plugin mkdocs-redirects mkdocs-simple-hooks @@ -29,7 +29,7 @@ jobs: outputs: code: ${{ steps.filter.outputs.code }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - id: filter uses: dorny/paths-filter@v2 with: @@ -51,7 +51,7 @@ jobs: permissions: security-events: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 1 - uses: github/codeql-action/init@v1 @@ -63,7 +63,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -74,7 +74,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -87,7 +87,7 @@ jobs: env: VAGRANT_BOX: debian11-i386 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/.vagrant.d @@ -102,7 +102,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -115,7 +115,7 @@ jobs: env: VAGRANT_BOX: freebsd13 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/.vagrant.d @@ -133,7 +133,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/go/pkg/mod @@ -169,7 +169,7 @@ jobs: env: VAGRANT_BOX: openbsd6 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/.vagrant.d @@ -186,7 +186,7 @@ jobs: env: VAGRANT_BOX: openindiana steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/.vagrant.d @@ -210,7 +210,7 @@ jobs: curl -fsSL https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz | tar xzf - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: actions/cache@v2 @@ -300,7 +300,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: 1.16.x - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/go/pkg/mod @@ -332,7 +332,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: 1.17.x - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/go/pkg/mod @@ -364,7 +364,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/go/pkg/mod @@ -393,7 +393,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -405,7 +405,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/cache@v2 with: path: ~/go/pkg/mod @@ -434,7 +434,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: golangci/[email protected] with: version: v${{ env.GOLANGCI_LINT_VERSION }} @@ -467,7 +467,7 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: actions/cache@v2 diff --git a/.github/workflows/misspell.yml b/.github/workflows/misspell.yml index f08a44c1c28..add44b44e43 100644 --- a/.github/workflows/misspell.yml +++ b/.github/workflows/misspell.yml @@ -13,7 +13,7 @@ jobs: name: spellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: misspell uses: reviewdog/action-misspell@v1 with:
chore
bump actions/checkout from 2 to 3
b9f27755499289823be3b09492576b3db68a2f54
2022-10-19 05:25:52
Tom Payne
chore: Fix attribute parsing of encrypted modify_ scripts
false
diff --git a/pkg/chezmoi/attr.go b/pkg/chezmoi/attr.go index 9340a6bfd4b..b5145b9b452 100644 --- a/pkg/chezmoi/attr.go +++ b/pkg/chezmoi/attr.go @@ -345,6 +345,9 @@ func (fa FileAttr) SourceName(encryptedSuffix string) string { } case SourceFileTypeModify: sourceName = modifyPrefix + if fa.Encrypted { + sourceName += encryptedPrefix + } if fa.Private { sourceName += privatePrefix } diff --git a/pkg/chezmoi/attr_test.go b/pkg/chezmoi/attr_test.go index bbfdf221ca7..afd40f2bee6 100644 --- a/pkg/chezmoi/attr_test.go +++ b/pkg/chezmoi/attr_test.go @@ -132,6 +132,7 @@ func TestFileAttr(t *testing.T) { require.NoError(t, combinator.Generate(&fileAttrs, struct { Type SourceFileTargetType TargetName []string + Encrypted []bool Executable []bool Private []bool ReadOnly []bool @@ -139,6 +140,7 @@ func TestFileAttr(t *testing.T) { }{ Type: SourceFileTypeModify, TargetName: targetNames, + Encrypted: []bool{false, true}, Executable: []bool{false, true}, Private: []bool{false, true}, ReadOnly: []bool{false, true},
chore
Fix attribute parsing of encrypted modify_ scripts
49bee8cf0d09f179250720ef9514cb89b3516933
2021-11-15 01:13:57
Tom Payne
chore: Use date of last commit as built at date
false
diff --git a/Makefile b/Makefile index f98313087f9..cd8ab46617a 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,14 @@ default: run build-all test lint format install: go install -ldflags "-X main.version=$(shell git describe --abbrev=0 --tags) \ -X main.commit=$(shell git rev-parse HEAD) \ - -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) \ + -X main.date=$(shell git show -s --format=%ct HEAD) \ -X main.builtBy=source" .PHONY: build build: go build -ldflags "-X main.version=$(shell git describe --abbrev=0 --tags) \ -X main.commit=$(shell git rev-parse HEAD) \ - -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) \ + -X main.date=$(shell git show -s --format=%ct HEAD) \ -X main.builtBy=source" .PHONY: build-all diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2f3d86faf3c..4fa77bd7e2e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -195,9 +195,11 @@ If you're packaging chezmoi for an operating system or distribution: `4d678ce6850c9d81c7ab2fe0d8f20c1547688b91`. The command `git rev-parse HEAD` will return a suitable value. - `$DATE` should be the date of the build in RFC3339 format, e.g. - `2019-11-23T18:29:25Z`. The command `date -u +%Y-%m-%dT%H:%M:%SZ` will return - a suitable value. + `$DATE` should be the date of the build as a UNIX timestamp or in RFC3339 + format. The command `git show -s --format=%ct HEAD` returns the UNIX timestamp + of the last commit, e.g. `1636668628`. The command `date -u + +%Y-%m-%dT%H:%M:%SZ` returns the current time in RFC3339 format, e.g. + `2019-11-23T18:29:25Z`. `$BUILT_BY` should be a string indicating what system was used to build the binary. Typically it should be the name of your packaging system, e.g. diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 286f37b98b6..b60d618c413 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -18,6 +18,7 @@ import ( "runtime" "runtime/pprof" "sort" + "strconv" "strings" "text/template" "time" @@ -1902,7 +1903,11 @@ func withVersionInfo(versionInfo VersionInfo) configOption { versionElems = append(versionElems, "commit "+versionInfo.Commit) } if versionInfo.Date != "" { - versionElems = append(versionElems, "built at "+versionInfo.Date) + date := versionInfo.Date + if sec, err := strconv.ParseInt(date, 10, 64); err == nil { + date = time.Unix(sec, 0).UTC().Format(time.RFC3339) + } + versionElems = append(versionElems, "built at "+date) } if versionInfo.BuiltBy != "" { versionElems = append(versionElems, "built by "+versionInfo.BuiltBy)
chore
Use date of last commit as built at date
7c70bff83d7c1dbe9ed3be486e3a6023e05c5426
2022-05-26 03:40:16
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 9a9afcf3a9d..5d635857a3e 100644 --- a/go.mod +++ b/go.mod @@ -32,13 +32,13 @@ require ( github.com/zalando/go-keyring v0.2.1 go.etcd.io/bbolt v1.3.6 go.uber.org/multierr v1.8.0 - golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 + golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 - gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 + gopkg.in/yaml.v3 v3.0.0 howett.net/plist v1.0.0 - mvdan.cc/sh/v3 v3.5.0 + mvdan.cc/sh/v3 v3.5.1 ) require ( @@ -66,7 +66,7 @@ require ( github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -92,13 +92,13 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.3.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect + github.com/subosito/gotenv v1.3.0 // indirect github.com/xanzy/ssh-agent v0.3.1 // indirect github.com/yuin/goldmark v1.4.12 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect - golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 // indirect + golang.org/x/net v0.0.0-20220524220425-1d687d428aca // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect diff --git a/go.sum b/go.sum index 8909b6d9018..4295b9d5783 100644 --- a/go.sum +++ b/go.sum @@ -368,8 +368,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -566,8 +567,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ= @@ -734,8 +736,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 h1:cCR+9mKLOGyX4Zx+uBZDXEDAQsvKQ/XbW4vreG5v1jU= -golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220524220425-1d687d428aca h1:xTaFYiPROfpPhqrfTIDXj0ri1SpfueYT951s4bAuDO8= +golang.org/x/net v0.0.0-20220524220425-1d687d428aca/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -755,8 +757,9 @@ golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1125,8 +1128,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 h1:dbuHpmKjkDzSOMKAWl10QNlgaZUd3V1q99xc81tt2Kc= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1139,8 +1142,8 @@ howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE= mvdan.cc/editorconfig v0.2.0/go.mod h1:lvnnD3BNdBYkhq+B4uBuFFKatfp02eB6HixDvEz91C0= -mvdan.cc/sh/v3 v3.5.0 h1:/wJEun8808ezNyNyaORnK80JAu4nimLbfibn9xOccFE= -mvdan.cc/sh/v3 v3.5.0/go.mod h1:1JcoyAKm1lZw/2bZje/iYKWicU/KMd0rsyJeKHnsK4E= +mvdan.cc/sh/v3 v3.5.1 h1:hmP3UOw4f+EYexsJjFxvU38+kn+V/s2CclXHanIBkmQ= +mvdan.cc/sh/v3 v3.5.1/go.mod h1:1JcoyAKm1lZw/2bZje/iYKWicU/KMd0rsyJeKHnsK4E= rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/goversion v1.2.0 h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w=
chore
Update dependencies
56729ce4f1b880c4068be1ae3a8de1ebef8af552
2024-10-23 01:22:06
Ruslan Sayfutdinov
docs: Automatically check that all flags are documented
false
diff --git a/assets/chezmoi.io/docs/reference/commands/add.md b/assets/chezmoi.io/docs/reference/commands/add.md index daebbd84e9e..7b0f8b4b87e 100644 --- a/assets/chezmoi.io/docs/reference/commands/add.md +++ b/assets/chezmoi.io/docs/reference/commands/add.md @@ -6,7 +6,7 @@ destination directory. ## Flags -### `--autotemplate` +### `-a`, `--autotemplate` Automatically generate a template by replacing strings that match variable values from the `data` section of the config file with their respective config @@ -46,7 +46,7 @@ Interactively prompt before adding each file. Suppress warnings about adding ignored entries. -### `-s`, `--secrets` `ignore`|`warning`|`error` +### `--secrets` `ignore`|`warning`|`error` > Configuration: `add.secrets` diff --git a/assets/chezmoi.io/docs/reference/commands/destroy.md b/assets/chezmoi.io/docs/reference/commands/destroy.md index 43fe06e01dd..419cd725e9f 100644 --- a/assets/chezmoi.io/docs/reference/commands/destroy.md +++ b/assets/chezmoi.io/docs/reference/commands/destroy.md @@ -14,7 +14,7 @@ Remove *target* from the source state, the destination directory, and the state. ## Common flags -### `-f`, `--force` +### `--force` Destroy without prompting. diff --git a/assets/chezmoi.io/docs/reference/commands/execute-template.md b/assets/chezmoi.io/docs/reference/commands/execute-template.md index e9f2b5bde03..af14b05689c 100644 --- a/assets/chezmoi.io/docs/reference/commands/execute-template.md +++ b/assets/chezmoi.io/docs/reference/commands/execute-template.md @@ -8,7 +8,7 @@ specified, the template is read from stdin. ## Flags -### `--init`, `-i` +### `-i`, `--init` Include simulated functions only available during `chezmoi init`. @@ -37,7 +37,7 @@ from *pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If `promptInt` is called with a *prompt* that does not match any of *pairs*, then it returns zero. -### `--promptString`, `-p` *pairs* +### `-p`, `--promptString` *pairs* Simulate the `promptString` template function with a function that returns values from *pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* diff --git a/assets/chezmoi.io/docs/reference/commands/import.md b/assets/chezmoi.io/docs/reference/commands/import.md index 531344bb7ff..ccd722867ab 100644 --- a/assets/chezmoi.io/docs/reference/commands/import.md +++ b/assets/chezmoi.io/docs/reference/commands/import.md @@ -10,7 +10,7 @@ The supported archive formats are `tar`, `tar.gz`, `tgz`, `tar.bz2`, `tbz2`, ## Flags -### `--destination` *directory* +### `-d`, `--destination` *directory* Set the destination (in the source state) where the archive will be imported. diff --git a/assets/chezmoi.io/docs/reference/commands/init.md b/assets/chezmoi.io/docs/reference/commands/init.md index 9297c8d4d0b..0abd6682d40 100644 --- a/assets/chezmoi.io/docs/reference/commands/init.md +++ b/assets/chezmoi.io/docs/reference/commands/init.md @@ -35,7 +35,7 @@ own binary. ## Flags -### `--apply` +### `-a`, `--apply` Run `chezmoi apply` after checking out the repo and creating the config file. @@ -43,7 +43,7 @@ Run `chezmoi apply` after checking out the repo and creating the config file. Check out *branch* instead of the default branch. -### `--config-path` *path* +### `-C`, `--config-path` *path* Write the generated config file to *path* instead of the default location. @@ -53,11 +53,11 @@ Include existing template data when creating the config file. This defaults to `true`. Set this to `false` to simulate creating the config file with no existing template data. -### `--depth` *depth* +### `-d`, `--depth` *depth* Clone the repo with depth *depth*. -### `--guess-repo-url` *bool* +### `-g`, `--guess-repo-url` *bool* Guess the repo URL from the *repo* argument. This defaults to `true`. @@ -105,11 +105,11 @@ a comma-separated list of *prompt*`=`*value* pairs. If `promptString` is called with a *prompt* that does not match any of *pairs*, then it prompts the user for a value. -### `--purge` +### `-p`, `--purge` Remove the source and config directories after applying. -### `--purge-binary` +### `-P`, `--purge-binary` Attempt to remove the chezmoi binary after applying. diff --git a/assets/chezmoi.io/docs/reference/commands/purge.md b/assets/chezmoi.io/docs/reference/commands/purge.md index c5d9707c632..008d1c81f3e 100644 --- a/assets/chezmoi.io/docs/reference/commands/purge.md +++ b/assets/chezmoi.io/docs/reference/commands/purge.md @@ -11,7 +11,7 @@ Purge chezmoi binary. ## Common flags -### `-f`, `--force` +### `--force` Remove without prompting. diff --git a/assets/chezmoi.io/docs/reference/commands/update.md b/assets/chezmoi.io/docs/reference/commands/update.md index fe57ba51971..4d888a70390 100644 --- a/assets/chezmoi.io/docs/reference/commands/update.md +++ b/assets/chezmoi.io/docs/reference/commands/update.md @@ -9,7 +9,7 @@ If `update.command` is set then chezmoi will run `update.command` with ## Flags -### `--apply` +### `-a`, `--apply` Apply changes after pulling, `true` by default. Can be disabled with `--apply=false`. @@ -33,6 +33,10 @@ defaults to `all`. Recreate config file from template. +### `-P`, `--parent-dirs` + +Also perform command on all parent directories of *target*. + ### `-r`, `--recursive` Recurse into subdirectories, `true` by default. Can be disabled with `--recursive=false`. diff --git a/assets/chezmoi.io/docs/reference/commands/verify.md b/assets/chezmoi.io/docs/reference/commands/verify.md index f71bdd384c3..7a428031515 100644 --- a/assets/chezmoi.io/docs/reference/commands/verify.md +++ b/assets/chezmoi.io/docs/reference/commands/verify.md @@ -20,6 +20,10 @@ defaults to `all`. Recreate config file from template. +### `-P`, `--parent-dirs` + +Also perform command on all parent directories of *target*. + ### `-r`, `--recursive` Recurse into subdirectories, `true` by default. Can be disabled with `--recursive=false`. diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index f5ae874ef04..b263d021491 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -15,6 +15,7 @@ import ( "github.com/charmbracelet/glamour" "github.com/charmbracelet/glamour/styles" "github.com/spf13/cobra" + "github.com/spf13/pflag" "go.etcd.io/bbolt" "github.com/twpayne/chezmoi/v2/assets/chezmoi.io/docs/reference/commands" @@ -30,6 +31,7 @@ var ( deDuplicateErrorRx = regexp.MustCompile(`:\s+`) trailingSpaceRx = regexp.MustCompile(` +\n`) + helpFlagsRx = regexp.MustCompile("^### (?:`-([a-zA-Z])`, )?`--([a-zA-Z-]+)`") helps = make(map[string]*help) ) @@ -43,8 +45,10 @@ type VersionInfo struct { } type help struct { - longHelp string - example string + longHelp string + example string + longFlags map[string]bool + shortFlags map[string]bool } func init() { @@ -155,6 +159,9 @@ func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermR state := stateReadTitle var longHelpLines []string var exampleLines []string + longFlags := make(map[string]bool) + shortFlags := make(map[string]bool) + stateChange := func(line string, state *stateType) bool { switch { case strings.HasPrefix(line, "## Flags") || strings.HasPrefix(line, "## Common flags"): @@ -169,9 +176,6 @@ func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermR case strings.HasPrefix(line, "## "): *state = stateInUnknownSection return true - case strings.HasPrefix(line, "!!! "): - *state = stateInAdmonition - return true } return false } @@ -189,13 +193,28 @@ func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermR return nil, fmt.Errorf("expected title for '%s'", command) } case stateInLongHelp: - if !stateChange(line, &state) { + switch { + case stateChange(line, &state): + break + case strings.HasPrefix(line, "!!! "): + state = stateInAdmonition + default: longHelpLines = append(longHelpLines, line) } case stateInExamples: if !stateChange(line, &state) { exampleLines = append(exampleLines, line) } + case stateInOptions: + if !stateChange(line, &state) { + matches := helpFlagsRx.FindStringSubmatch(line) + if matches != nil { + if matches[1] != "" { + shortFlags[matches[1]] = true + } + longFlags[matches[2]] = true + } + } default: stateChange(line, &state) } @@ -210,8 +229,10 @@ func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermR return nil, err } return &help{ - longHelp: "Description:\n" + longHelp, - example: example, + longHelp: "Description:\n" + longHelp, + example: example, + longFlags: longFlags, + shortFlags: shortFlags, }, nil } @@ -245,6 +266,39 @@ func mustLongHelp(command string) string { return help.longHelp } +func ensureAllFlagsDocumented(cmd *cobra.Command, persistentFlags *pflag.FlagSet) { + cmdName := cmd.Name() + help, ok := helps[cmdName] + if !ok && !cmd.Flags().HasFlags() { + return + } + if !ok { + panic(cmdName + ": missing flags") + } + // Check if all flags are documented. + cmd.Flags().VisitAll(func(flag *pflag.Flag) { + if _, ok := help.longFlags[flag.Name]; !ok { + panic(fmt.Sprintf("%s: undocumented long flag --%s", cmdName, flag.Name)) + } + if flag.Shorthand != "" { + if _, ok := help.shortFlags[flag.Shorthand]; !ok { + panic(fmt.Sprintf("%s: undocumented short flag -%s", cmdName, flag.Shorthand)) + } + } + }) + // Check if all documented flags exist. + for flag := range help.longFlags { + if cmd.Flags().Lookup(flag) == nil && persistentFlags.Lookup(flag) == nil { + panic(fmt.Sprintf("%s: flag --%s documented but not implemented", cmdName, flag)) + } + } + for flag := range help.shortFlags { + if cmd.Flags().ShorthandLookup(flag) == nil && persistentFlags.ShorthandLookup(flag) == nil { + panic(fmt.Sprintf("%s: flag -%s documented but not implemented", cmdName, flag)) + } + } +} + // runMain runs chezmoi's main function. func runMain(versionInfo VersionInfo, args []string) (err error) { if versionInfo.Commit == "" || versionInfo.Date == "" { diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 3164bb409c4..0a6f98289e6 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -1740,6 +1740,7 @@ func (c *Config) newRootCmd() (*cobra.Command, error) { c.newVerifyCmd(), } { if cmd != nil { + ensureAllFlagsDocumented(cmd, persistentFlags) registerCommonFlagCompletionFuncs(cmd) rootCmd.AddCommand(cmd) } diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index 42454ffbc6b..605d95e51cf 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -165,7 +165,7 @@ func (c *Config) newDoctorCmd() *cobra.Command { ), } - doctorCmd.PersistentFlags().BoolVar(&c.doctor.noNetwork, "no-network", c.doctor.noNetwork, "do not use network connection") + doctorCmd.Flags().BoolVar(&c.doctor.noNetwork, "no-network", c.doctor.noNetwork, "do not use network connection") return doctorCmd }
docs
Automatically check that all flags are documented
bf0f5c42d506c4164a4b1a9618644396e1281fdc
2022-01-29 23:06:47
Tom Payne
chore: Tidy up Bitwarden template functions
false
diff --git a/pkg/cmd/bitwardentemplatefuncs.go b/pkg/cmd/bitwardentemplatefuncs.go index a2feaac15da..bd5e75c4abe 100644 --- a/pkg/cmd/bitwardentemplatefuncs.go +++ b/pkg/cmd/bitwardentemplatefuncs.go @@ -12,8 +12,21 @@ type bitwardenConfig struct { outputCache map[string][]byte } +func (c *Config) bitwardenAttachmentTemplateFunc(name, itemid string) string { + output, err := c.bitwardenOutput([]string{"attachment", name, "--itemid", itemid, "--raw"}) + if err != nil { + returnTemplateError(err) + return "" + } + return string(output) +} + func (c *Config) bitwardenFieldsTemplateFunc(args ...string) map[string]interface{} { - output := c.bitwardenOutput(args) + output, err := c.bitwardenOutput(args) + if err != nil { + returnTemplateError(err) + return nil + } var data struct { Fields []map[string]interface{} `json:"fields"` } @@ -30,10 +43,24 @@ func (c *Config) bitwardenFieldsTemplateFunc(args ...string) map[string]interfac return result } -func (c *Config) bitwardenOutput(args []string) []byte { +func (c *Config) bitwardenTemplateFunc(args ...string) map[string]interface{} { + output, err := c.bitwardenOutput(args) + if err != nil { + returnTemplateError(err) + return nil + } + var data map[string]interface{} + if err := json.Unmarshal(output, &data); err != nil { + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Bitwarden.Command, args), err, output)) + return nil + } + return data +} + +func (c *Config) bitwardenOutput(args []string) ([]byte, error) { key := strings.Join(args, "\x00") if data, ok := c.Bitwarden.outputCache[key]; ok { - return data + return data, nil } name := c.Bitwarden.Command @@ -43,27 +70,12 @@ func (c *Config) bitwardenOutput(args []string) []byte { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) - return nil + return nil, fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output) } if c.Bitwarden.outputCache == nil { c.Bitwarden.outputCache = make(map[string][]byte) } c.Bitwarden.outputCache[key] = output - return output -} - -func (c *Config) bitwardenTemplateFunc(args ...string) map[string]interface{} { - output := c.bitwardenOutput(args) - var data map[string]interface{} - if err := json.Unmarshal(output, &data); err != nil { - returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Bitwarden.Command, args), err, output)) - return nil - } - return data -} - -func (c *Config) bitwardenAttachmentTemplateFunc(name, itemid string) string { - return string(c.bitwardenOutput([]string{"attachment", name, "--itemid", itemid, "--raw"})) + return output, nil }
chore
Tidy up Bitwarden template functions
8e40c439736ff5dc597eb39e0cee244f40826839
2024-08-14 19:01:42
Tom Payne
docs: Add link to video
false
diff --git a/assets/chezmoi.io/docs/links/videos.md.yaml b/assets/chezmoi.io/docs/links/videos.md.yaml index 6d2e6294c26..f5b28ee961a 100644 --- a/assets/chezmoi.io/docs/links/videos.md.yaml +++ b/assets/chezmoi.io/docs/links/videos.md.yaml @@ -53,3 +53,7 @@ videos: version: 2.47.0 title: '12 GREAT command line programs YOU recommended!' url: https://www.youtube.com/watch?v=nCS4BtJ34-o&t=324s +- date: '2024-06-22' + version: '2.47.1' + title: 'Automating Development Environments with Ansible & Chezmoi' + url: https://www.youtube.com/watch?v=P4nI1VhoN2Y
docs
Add link to video
a95efb3d3493fa1c31b2aed9a3a31310ba96bc66
2023-12-01 14:15:25
dependabot[bot]
chore(deps): bump dessant/lock-threads from 5.0.0 to 5.0.1
false
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 5f2c1397a90..d2573201484 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: action: runs-on: ubuntu-22.04 steps: - - uses: dessant/lock-threads@d42e5f49803f3c4e14ffee0378e31481265dda22 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 with: issue-lock-reason: resolved issue-inactive-days: 7
chore
bump dessant/lock-threads from 5.0.0 to 5.0.1
6c5564db1ee8d428f7f9b453c5c9f0250f7cde90
2022-02-26 22:39:00
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 8f9ed833c00..33078e7e9a4 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/huandu/xstrings v1.3.2 // indirect github.com/kevinburke/ssh_config v1.1.0 // indirect + github.com/magiconair/properties v1.8.6 // indirect github.com/microcosm-cc/bluemonday v1.0.18 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 @@ -49,10 +50,10 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 + golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 0b9705d02f1..7834f00cb61 100644 --- a/go.sum +++ b/go.sum @@ -449,8 +449,9 @@ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69 github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-star v0.5.3 h1:zSGLzsUew8RT+ZKPHc3jnf8XLaVyHzTcAFBzHtCNR20= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -786,8 +787,9 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -804,8 +806,9 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -897,8 +900,8 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7 h1:BXxu8t6QN0G1uff4bzZzSkpsax8+ALqTGUtz08QrV00= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
chore
Update dependencies
da66978f76f82b5d6d50dcd1fbca314da1f34b1c
2022-10-12 17:16:45
Tom Payne
chore: Add COMMIT file to source archives
false
diff --git a/.gitignore b/.gitignore index d8b3addc21e..de7d1c86cff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.vagrant +/COMMIT /bin/chezmoi /bin/gofumpt /bin/golangci-lint diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 667e3c63d0e..737785a1280 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -2,6 +2,7 @@ project_name: chezmoi before: hooks: + - assets/scripts/generate-commit.sh -o COMMIT - go mod download all builds: @@ -229,3 +230,5 @@ snapcrafts: source: enabled: true prefix_template: '{{ .ProjectName }}-{{ .Version }}/' + files: + - COMMIT diff --git a/assets/chezmoi.io/docs/developer/packaging.md b/assets/chezmoi.io/docs/developer/packaging.md index ef1c3c1af34..810c9a7ecd4 100644 --- a/assets/chezmoi.io/docs/developer/packaging.md +++ b/assets/chezmoi.io/docs/developer/packaging.md @@ -31,8 +31,13 @@ optional and will be stripped, so you can pass the git tag in directly. !!! hint - The command `git rev-parse HEAD` will return a suitable value for - `$COMMIT`. + The `assets/scripts/generate-commit.sh` script will return a suitable value + for `$COMMIT`. + +!!! hint + + The source archive contains a file called `COMMIT` containing the commit + hash. `$DATE` should be the date of the build as a UNIX timestamp or in RFC3339 format. diff --git a/assets/scripts/generate-commit.sh b/assets/scripts/generate-commit.sh new file mode 100755 index 00000000000..7fe7b4c5c3e --- /dev/null +++ b/assets/scripts/generate-commit.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +output="" +while getopts "o:" arg; do + case "${arg}" in + o) output="${OPTARG}" ;; + *) exit 1 ;; + esac +done + +commit="$(git rev-parse HEAD)" +if ! git diff-index --quiet HEAD; then + commit="${commit}-dirty" +fi + +if [ -z "${output}" ]; then + echo "${commit}" +else + echo "${commit}" > "${output}" +fi diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index 7da1d7a9e02..38371b87a2b 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -284,7 +284,7 @@ func runMain(versionInfo VersionInfo, args []string) (err error) { if versionInfo.Commit == "" && vcs == "git" { versionInfo.Commit = vcsRevision if modified, err := strconv.ParseBool(vcsModified); err == nil && modified { - versionInfo.Commit += " (modified)" + versionInfo.Commit += "-dirty" } } if versionInfo.Date == "" {
chore
Add COMMIT file to source archives
71ca1f65358590eb77744475785b9536c0eb3532
2022-01-21 03:35:58
Tom Payne
fix: Ignore files and directories beginning with . in .chezmoitemplates
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 61de70ac3d8..0cec46638e1 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -1095,12 +1095,22 @@ func (s *SourceState) addTemplateData(sourceAbsPath AbsPath) error { // addTemplatesDir adds all templates in templatesDirAbsPath to s. func (s *SourceState) addTemplatesDir(templatesDirAbsPath AbsPath) error { walkFunc := func(templateAbsPath AbsPath, fileInfo fs.FileInfo, err error) error { + if templateAbsPath == templatesDirAbsPath { + return nil + } if err == nil && fileInfo.Mode().Type() == fs.ModeSymlink { fileInfo, err = s.system.Stat(templateAbsPath) } switch { case err != nil: return err + case strings.HasPrefix(fileInfo.Name(), Prefix): + return fmt.Errorf("%s: not allowed in %s directory", templatesDirName, templateAbsPath) + case strings.HasPrefix(fileInfo.Name(), "."): + if fileInfo.IsDir() { + return vfs.SkipDir + } + return nil case fileInfo.Mode().IsRegular(): contents, err := s.system.ReadFile(templateAbsPath) if err != nil { diff --git a/internal/cmd/testdata/scripts/edgecases.txt b/internal/cmd/testdata/scripts/edgecases.txt index 40a1a75e663..7c4370b957e 100644 --- a/internal/cmd/testdata/scripts/edgecases.txt +++ b/internal/cmd/testdata/scripts/edgecases.txt @@ -41,9 +41,15 @@ chhome home3/user ! chezmoi apply stderr 'chezmoi: \.file: inconsistent state \(\.chezmoiremove, dot_file\)' -skip 'FIXME make the following test pass' chhome home4/user +# test that chezmoi reports an error if there is a .chezmoi* file in the .chezmoitemplates directory +! chezmoi status +! stderr 'not allowed in \.chezmoitemplates directory' + +skip 'FIXME make the following test pass' +chhome home5/user + # test that chezmoi reports an inconsistent state error when a file should be both removed and present, even if the file is not already present ! chezmoi apply stderr 'chezmoi: \.file: inconsistent state \(\.chezmoiremove, dot_file\)' @@ -58,7 +64,8 @@ stderr 'chezmoi: \.file: inconsistent state \(\.chezmoiremove, dot_file\)' .file -- home3/user/.local/share/chezmoi/dot_file -- # contents of .file --- home4/user/.local/share/chezmoi/.chezmoiremove -- +-- home4/user/.local/share/chezmoi/.chezmoitemplates/.chezmoiignore -- +-- home5/user/.local/share/chezmoi/.chezmoiremove -- .file --- home4/user/.local/share/chezmoi/dot_file -- +-- home5/user/.local/share/chezmoi/dot_file -- # contents of .file diff --git a/internal/cmd/testdata/scripts/executetemplate.txt b/internal/cmd/testdata/scripts/executetemplate.txt index 92b2604a33b..8b0c514c68a 100644 --- a/internal/cmd/testdata/scripts/executetemplate.txt +++ b/internal/cmd/testdata/scripts/executetemplate.txt @@ -101,5 +101,7 @@ last: format: ".chezmoidata.yaml" global: ".chezmoidata.yaml" yaml: ".chezmoidata.yaml" +-- home/user/.local/share/chezmoi/.chezmoitemplates/.ignore -- +{{ "invalid template" -- home/user/.local/share/chezmoi/.chezmoitemplates/partial -- {{ cat "hello" "world" }}
fix
Ignore files and directories beginning with . in .chezmoitemplates
f98264ba7ffaf4dee8c70284a24a5a160a9428d0
2022-08-19 22:08:17
Tom Payne
feat: Add --prompt* flags to init command
false
diff --git a/assets/chezmoi.io/docs/reference/commands/execute-template.md b/assets/chezmoi.io/docs/reference/commands/execute-template.md index 84d2e63c26b..abb7ac6a46c 100644 --- a/assets/chezmoi.io/docs/reference/commands/execute-template.md +++ b/assets/chezmoi.io/docs/reference/commands/execute-template.md @@ -11,24 +11,24 @@ Include simulated functions only available during `chezmoi init`. ## `--promptBool` *pairs* -Simulate the `promptBool` function with a function that returns values from -*pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If +Simulate the `promptBool` template function with a function that returns values +from *pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If `promptBool` is called with a *prompt* that does not match any of *pairs*, then it returns false. ## `--promptInt` *pairs* -Simulate the `promptInt` function with a function that returns values from -*pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If +Simulate the `promptInt` template function with a function that returns values +from *pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If `promptInt` is called with a *prompt* that does not match any of *pairs*, then it returns zero. ## `--promptString`, `-p` *pairs* -Simulate the `promptString` function with a function that returns values from -*pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* pairs. If -`promptString` is called with a *prompt* that does not match any of *pairs*, -then it returns *prompt* unchanged. +Simulate the `promptString` template function with a function that returns +values from *pairs*. *pairs* is a comma-separated list of *prompt*`=`*value* +pairs. If `promptString` is called with a *prompt* that does not match any of +*pairs*, then it returns *prompt* unchanged. ## `--stdinisatty` *bool* diff --git a/assets/chezmoi.io/docs/reference/commands/init.md b/assets/chezmoi.io/docs/reference/commands/init.md index e369ce85bfb..44d4723997d 100644 --- a/assets/chezmoi.io/docs/reference/commands/init.md +++ b/assets/chezmoi.io/docs/reference/commands/init.md @@ -59,6 +59,27 @@ Clone the repo with depth *depth*. Force the `prompt*Once` template functions to prompt. +## `--promptBool` *pairs* + +Populate the `promptBool` template function with values from *pairs*. *pairs* is +a comma-separated list of *prompt*`=`*value* pairs. If `promptBool` is called +with a *prompt* that does not match any of *pairs*, then it prompts the user for +a value. + +## `--promptInt` *pairs* + +Populate the `promptInt` template function with values from *pairs*. *pairs* is +a comma-separated list of *prompt*`=`*value* pairs. If `prompInt` is called +with a *prompt* that does not match any of *pairs*, then it prompts the user for +a value. + +## `--promptString` *pairs* + +Populate the `promptString` template function with values from *pairs*. *pairs* is +a comma-separated list of *prompt*`=`*value* pairs. If `promptString` is called +with a *prompt* that does not match any of *pairs*, then it prompts the user for +a value. + ## `--guess-repo-url` *bool* Guess the repo URL from the *repo* argument. This defaults to `true`. diff --git a/pkg/cmd/initcmd.go b/pkg/cmd/initcmd.go index 0791e42dbe0..abe8525da54 100644 --- a/pkg/cmd/initcmd.go +++ b/pkg/cmd/initcmd.go @@ -28,6 +28,9 @@ type initCmdConfig struct { guessRepoURL bool oneShot bool forcePromptOnce bool + promptBool map[string]string + promptInt map[string]int + promptString map[string]string purge bool purgeBinary bool ssh bool @@ -120,6 +123,9 @@ func (c *Config) newInitCmd() *cobra.Command { flags.BoolVar(&c.init.forcePromptOnce, "prompt", c.init.forcePromptOnce, "Force prompt*Once template functions to prompt") //nolint:lll flags.BoolVarP(&c.init.guessRepoURL, "guess-repo-url", "g", c.init.guessRepoURL, "Guess the repo URL") flags.BoolVar(&c.init.oneShot, "one-shot", c.init.oneShot, "Run in one-shot mode") + flags.StringToStringVar(&c.init.promptBool, "promptBool", c.init.promptBool, "Populate promptBool") + flags.StringToIntVar(&c.init.promptInt, "promptInt", c.init.promptInt, "Populate promptInt") + flags.StringToStringVar(&c.init.promptString, "promptString", c.init.promptString, "Populate promptString") flags.BoolVarP(&c.init.purge, "purge", "p", c.init.purge, "Purge config and source directories after running") flags.BoolVarP(&c.init.purgeBinary, "purge-binary", "P", c.init.purgeBinary, "Purge chezmoi binary after running") flags.BoolVar(&c.init.ssh, "ssh", false, "Use ssh instead of https when guessing dotfile repo URL") diff --git a/pkg/cmd/inittemplatefuncs.go b/pkg/cmd/inittemplatefuncs.go index 0a4c4db0a8b..8aab77b8460 100644 --- a/pkg/cmd/inittemplatefuncs.go +++ b/pkg/cmd/inittemplatefuncs.go @@ -16,16 +16,29 @@ func (c *Config) exitInitTemplateFunc(code int) string { } func (c *Config) promptBoolInitTemplateFunc(prompt string, args ...bool) bool { + if len(args) > 1 { + err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) + panic(err) + } + + if valueStr, ok := c.init.promptBool[prompt]; ok { + value, err := parseBool(valueStr) + if err != nil { + panic(err) + } + return value + } + switch len(args) { case 0: - value, err := parseBool(c.promptStringInitTemplateFunc(prompt)) + value, err := parseBool(c.promptString(prompt)) if err != nil { panic(err) } return value case 1: prompt += " (default " + strconv.FormatBool(args[0]) + ")" - valueStr := c.promptStringInitTemplateFunc(prompt) + valueStr := c.promptString(prompt) if valueStr == "" { return args[0] } @@ -35,8 +48,7 @@ func (c *Config) promptBoolInitTemplateFunc(prompt string, args ...bool) bool { } return value default: - err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) - panic(err) + panic("unreachable") } } @@ -45,6 +57,7 @@ func (c *Config) promptBoolOnceInitTemplateFunc(m map[string]any, key, prompt st err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) panic(err) } + if !c.init.forcePromptOnce { if value, ok := m[key]; ok { if boolValue, ok := value.(bool); ok { @@ -52,20 +65,30 @@ func (c *Config) promptBoolOnceInitTemplateFunc(m map[string]any, key, prompt st } } } + return c.promptBoolInitTemplateFunc(prompt, args...) } func (c *Config) promptIntInitTemplateFunc(prompt string, args ...int64) int64 { + if len(args) > 1 { + err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) + panic(err) + } + + if value, ok := c.init.promptInt[prompt]; ok { + return int64(value) + } + switch len(args) { case 0: - value, err := strconv.ParseInt(c.promptStringInitTemplateFunc(prompt), 10, 64) + value, err := strconv.ParseInt(c.promptString(prompt), 10, 64) if err != nil { panic(err) } return value case 1: promptStr := prompt + " (default " + strconv.FormatInt(args[0], 10) + ")" - valueStr := c.promptStringInitTemplateFunc(promptStr) + valueStr := c.promptString(promptStr) if valueStr == "" { return args[0] } @@ -75,8 +98,7 @@ func (c *Config) promptIntInitTemplateFunc(prompt string, args ...int64) int64 { } return value default: - err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) - panic(err) + panic("unreachable") } } @@ -85,6 +107,7 @@ func (c *Config) promptIntOnceInitTemplateFunc(m map[string]any, key, prompt str err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) panic(err) } + if !c.init.forcePromptOnce { if value, ok := m[key]; ok { if intValue, ok := value.(int64); ok { @@ -92,10 +115,41 @@ func (c *Config) promptIntOnceInitTemplateFunc(m map[string]any, key, prompt str } } } + return c.promptIntInitTemplateFunc(prompt, args...) } func (c *Config) promptStringInitTemplateFunc(prompt string, args ...string) string { + if len(args) > 1 { + err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) + panic(err) + } + + if value, ok := c.init.promptString[prompt]; ok { + return value + } + + return c.promptString(prompt, args...) +} + +func (c *Config) promptStringOnceInitTemplateFunc(m map[string]any, key, prompt string, args ...string) string { + if len(args) > 1 { + err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) + panic(err) + } + + if !c.init.forcePromptOnce { + if value, ok := m[key]; ok { + if stringValue, ok := value.(string); ok { + return stringValue + } + } + } + + return c.promptStringInitTemplateFunc(prompt, args...) +} + +func (c *Config) promptString(prompt string, args ...string) string { switch len(args) { case 0: value, err := c.readLine(prompt + "? ") @@ -115,24 +169,9 @@ func (c *Config) promptStringInitTemplateFunc(prompt string, args ...string) str return strings.TrimSpace(value) } default: - err := fmt.Errorf("want 1 or 2 arguments, got %d", len(args)+1) - panic(err) - } -} - -func (c *Config) promptStringOnceInitTemplateFunc(m map[string]any, key, prompt string, args ...string) string { - if len(args) > 1 { - err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) + err := fmt.Errorf("want 0 or 1 arguments, got %d", len(args)) panic(err) } - if !c.init.forcePromptOnce { - if value, ok := m[key]; ok { - if stringValue, ok := value.(string); ok { - return stringValue - } - } - } - return c.promptStringInitTemplateFunc(prompt, args...) } func (c *Config) stdinIsATTYInitTemplateFunc() bool { diff --git a/pkg/cmd/testdata/scripts/init.txt b/pkg/cmd/testdata/scripts/init.txt index 3466b2af274..e5d3d02fca1 100644 --- a/pkg/cmd/testdata/scripts/init.txt +++ b/pkg/cmd/testdata/scripts/init.txt @@ -108,12 +108,23 @@ exec git init $HOME/.local/share chezmoi init ! exists $CHEZMOISOURCEDIR/.git +chhome home12/user + +# test chezmoi init --prompt* +chezmoi init --promptBool bool=true --promptInt int=1 --promptString bool=string +cmp $CHEZMOICONFIGDIR/chezmoi.yaml golden/chezmoi.yaml + -- golden/chezmoi.toml -- [data] email = "[email protected]" -- golden/chezmoi.toml-no-data -- [data] email = "[email protected]" +-- golden/chezmoi.yaml -- +data: + bool: true + int: 1 + string: string -- home4/user/.config/chezmoi/chezmoi.toml -- -- home5/user/dotfiles/.git/.keep -- -- home5/user/dotfiles/.chezmoi.toml.tmpl -- @@ -133,3 +144,8 @@ chezmoi init -- home8/user/.local/share/chezmoi/.chezmoi.toml.tmpl -- [diff] exclude: ["scripts"] +-- home12/user/.local/share/chezmoi/.chezmoi.yaml.tmpl -- +data: + bool: {{ promptBool "bool" }} + int: {{ promptInt "int" }} + string: {{ promptString "bool" }}
feat
Add --prompt* flags to init command
3c80e7ab836c6ada65d7abf2936ce83c310b3ea0
2024-10-23 04:31:13
Tom Payne
chore: Update GitHub Actions
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9eb31789db3..edfcdd0defc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -306,7 +306,7 @@ jobs: - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 + - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
chore
Update GitHub Actions
3738cd7b3ecd50bcd4f2b3db7186abc9e8fd47f6
2024-11-17 19:01:51
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 55c876cec74..6e48c1f5e0b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/Shopify/ejson v1.5.3 github.com/alecthomas/assert/v2 v2.11.0 github.com/aws/aws-sdk-go-v2 v1.32.4 - github.com/aws/aws-sdk-go-v2/config v1.28.3 + github.com/aws/aws-sdk-go-v2/config v1.28.4 github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.5 github.com/bmatcuk/doublestar/v4 v4.7.1 github.com/bradenhilton/mozillainstallhash v1.0.1 @@ -73,7 +73,7 @@ require ( github.com/alecthomas/chroma/v2 v2.14.0 // indirect github.com/alecthomas/repr v0.4.0 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.44 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.45 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect @@ -82,8 +82,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.32.4 // indirect - github.com/aws/smithy-go v1.22.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.0 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradenhilton/cityhash v1.0.0 // indirect @@ -159,7 +159,7 @@ require ( golang.org/x/net v0.31.0 // indirect golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.27.0 // indirect - google.golang.org/protobuf v1.35.1 // indirect + google.golang.org/protobuf v1.35.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 26ff31069c0..8835fac03a4 100644 --- a/go.sum +++ b/go.sum @@ -73,10 +73,10 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go-v2 v1.32.4 h1:S13INUiTxgrPueTmrm5DZ+MiAo99zYzHEFh1UNkOxNE= github.com/aws/aws-sdk-go-v2 v1.32.4/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= -github.com/aws/aws-sdk-go-v2/config v1.28.3 h1:kL5uAptPcPKaJ4q0sDUjUIdueO18Q7JDzl64GpVwdOM= -github.com/aws/aws-sdk-go-v2/config v1.28.3/go.mod h1:SPEn1KA8YbgQnwiJ/OISU4fz7+F6Fe309Jf0QTsRCl4= -github.com/aws/aws-sdk-go-v2/credentials v1.17.44 h1:qqfs5kulLUHUEXlHEZXLJkgGoF3kkUeFUTVA585cFpU= -github.com/aws/aws-sdk-go-v2/credentials v1.17.44/go.mod h1:0Lm2YJ8etJdEdw23s+q/9wTpOeo2HhNE97XcRa7T8MA= +github.com/aws/aws-sdk-go-v2/config v1.28.4 h1:qgD0MKmkIzZR2DrAjWJcI9UkndjR+8f6sjUQvXh0mb0= +github.com/aws/aws-sdk-go-v2/config v1.28.4/go.mod h1:LgnWnNzHZw4MLplSyEGia0WgJ/kCGD86zGCjvNpehJs= +github.com/aws/aws-sdk-go-v2/credentials v1.17.45 h1:DUgm5lFso57E7150RBgu1JpVQoF8fAPretiDStIuVjg= +github.com/aws/aws-sdk-go-v2/credentials v1.17.45/go.mod h1:dnBpENcPC1ekZrGpSWspX+ZRGzhkvqngT2Qp5xBR1dY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 h1:woXadbf0c7enQ2UGCi8gW/WuKmE0xIzxBF/eD94jMKQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19/go.mod h1:zminj5ucw7w0r65bP6nhyOd3xL6veAUMc3ElGMoLVb4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 h1:A2w6m6Tmr+BNXjDsr7M90zkWjsu4JXHwrzPg235STs4= @@ -95,10 +95,10 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 h1:HJwZwRt2Z2Tdec+m+fPjvdmkq2s9 github.com/aws/aws-sdk-go-v2/service/sso v1.24.5/go.mod h1:wrMCEwjFPms+V86TCQQeOxQF/If4vT44FGIOFiMC2ck= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 h1:zcx9LiGWZ6i6pjdcoE9oXAB6mUdeyC36Ia/QEiIvYdg= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4/go.mod h1:Tp/ly1cTjRLGBBmNccFumbZ8oqpZlpdhFf80SrRh4is= -github.com/aws/aws-sdk-go-v2/service/sts v1.32.4 h1:yDxvkz3/uOKfxnv8YhzOi9m+2OGIxF+on3KOISbK5IU= -github.com/aws/aws-sdk-go-v2/service/sts v1.32.4/go.mod h1:9XEUty5v5UAsMiFOBJrNibZgwCeOma73jgGwwhgffa8= -github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= -github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.0 h1:s7LRgBqhwLaxcocnAniBJp7gaAB+4I4vHzqUqjH18yc= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.0/go.mod h1:9XEUty5v5UAsMiFOBJrNibZgwCeOma73jgGwwhgffa8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= @@ -597,8 +597,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
chore
Update dependencies
2dc345ee2e6e096b0623b56ecfd18cd17120f09f
2023-12-12 04:55:46
Tom Payne
chore: Update GitHub Actions
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23230ef7a48..b4c34f98698 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,7 +90,7 @@ jobs: runs-on: macos-11 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: build @@ -120,7 +120,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: oldstable - name: build @@ -147,7 +147,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: install-release-dependencies @@ -210,7 +210,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: install-age @@ -248,7 +248,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: install-website-dependencies @@ -264,7 +264,7 @@ jobs: runs-on: windows-2022 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 @@ -303,7 +303,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: generate @@ -333,7 +333,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc @@ -375,7 +375,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 @@ -401,7 +401,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 0 - - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - name: prepare-chezmoi.io
chore
Update GitHub Actions
fb213c1bd08c1759b30b66d69223d6e3892ba05e
2023-10-29 22:21:24
Tom Payne
chore: Update golangci-lint to v1.55.1
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc12c3be2aa..c31b5061936 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ env: CHOCOLATEY_VERSION: 2.2.2 GO_VERSION: 1.21.3 GOFUMPT_VERSION: 0.5.0 - GOLANGCI_LINT_VERSION: 1.54.2 + GOLANGCI_LINT_VERSION: 1.55.1 GOLINES_VERSION: 0.11.0 GOVERSIONINFO_VERSION: 1.4.0 FIND_TYPOS_VERSION: 0.0.3 diff --git a/.golangci.yml b/.golangci.yml index b09d06a133f..375d59113cd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,6 +23,7 @@ linters: - forcetypeassert - gci - gocheckcompilerdirectives + - gochecksumtype - gocritic - godot - goerr113 @@ -37,6 +38,7 @@ linters: - govet - grouper - importas + - inamedparam - ineffassign - interfacebloat - ireturn @@ -48,12 +50,15 @@ linters: - noctx - nolintlint - nosprintfhostport + - perfsprint - prealloc - predeclared - promlinter + - protogetter - reassign - revive - rowserrcheck + - sloglint - sqlclosecheck - staticcheck - stylecheck diff --git a/internal/chezmoi/glob.go b/internal/chezmoi/glob.go index 79c413a98aa..21dab1980dd 100644 --- a/internal/chezmoi/glob.go +++ b/internal/chezmoi/glob.go @@ -11,7 +11,7 @@ import ( type lstatFS struct { wrapped interface { fs.FS - Lstat(string) (fs.FileInfo, error) + Lstat(name string) (fs.FileInfo, error) } } diff --git a/internal/cmd/managedcmd.go b/internal/cmd/managedcmd.go index 08800881388..df937236ad7 100644 --- a/internal/cmd/managedcmd.go +++ b/internal/cmd/managedcmd.go @@ -52,7 +52,7 @@ func (c *Config) runManagedCmd( return err } else if relPath, err := absPath.TrimDirPrefix(c.DestDirAbsPath); err != nil { return err - } else { + } else { //nolint:revive relPaths = append(relPaths, relPath) } }
chore
Update golangci-lint to v1.55.1
3836bde8f2ebaee5b5683b138a986dd97f793238
2021-11-02 03:40:47
Tom Payne
chore: Improve error message for inconsistent state
false
diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 908ee5d1e5a..7efaf5af5a4 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -88,13 +88,13 @@ var modeTypeNames = map[fs.FileMode]string{ fs.ModeCharDevice: "char device", } -type duplicateTargetError struct { +type inconsistentStateError struct { targetRelPath RelPath origins []string } -func (e *duplicateTargetError) Error() string { - return fmt.Sprintf("%s: duplicate source state entries (%s)", e.targetRelPath, strings.Join(e.origins, ", ")) +func (e *inconsistentStateError) Error() string { + return fmt.Sprintf("%s: inconsistent state (%s)", e.targetRelPath, strings.Join(e.origins, ", ")) } type notInAbsDirError struct { diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 74fad2e8c2b..9e4728d68a2 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -872,8 +872,8 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } } - // Check for duplicate source entries with the same target name. Iterate - // over the target names in order so that any error is deterministic. + // Check for inconsistent source entries. Iterate over the target names in + // order so that any error is deterministic. targetRelPaths := make(RelPaths, 0, len(allSourceStateEntries)) for targetRelPath := range allSourceStateEntries { targetRelPaths = append(targetRelPaths, targetRelPath) @@ -896,7 +896,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { origins = append(origins, sourceStateEntry.Origin()) } sort.Strings(origins) - err = multierr.Append(err, &duplicateTargetError{ + err = multierr.Append(err, &inconsistentStateError{ targetRelPath: targetRelPath, origins: origins, }) diff --git a/internal/chezmoi/sourcestate_test.go b/internal/chezmoi/sourcestate_test.go index da88bcd5474..616b62bc756 100644 --- a/internal/chezmoi/sourcestate_test.go +++ b/internal/chezmoi/sourcestate_test.go @@ -903,7 +903,7 @@ func TestSourceStateRead(t *testing.T) { "dot_file.tmpl": "# contents of .file\n", }, }, - expectedError: ".file: duplicate source state entries (dot_file, dot_file.tmpl)", + expectedError: ".file: inconsistent state (dot_file, dot_file.tmpl)", }, { name: "duplicate_target_dir", @@ -917,7 +917,7 @@ func TestSourceStateRead(t *testing.T) { }, }, }, - expectedError: "dir: duplicate source state entries (dir, exact_dir)", + expectedError: "dir: inconsistent state (dir, exact_dir)", }, { name: "duplicate_target_script", @@ -927,7 +927,7 @@ func TestSourceStateRead(t *testing.T) { "run_once_script": "#!/bin/sh\n", }, }, - expectedError: "script: duplicate source state entries (run_once_script, run_script)", + expectedError: "script: inconsistent state (run_once_script, run_script)", }, { name: "symlink_with_attr", diff --git a/internal/cmd/testdata/scripts/errors.txt b/internal/cmd/testdata/scripts/errors.txt index d9078d6b81b..61163f915f2 100644 --- a/internal/cmd/testdata/scripts/errors.txt +++ b/internal/cmd/testdata/scripts/errors.txt @@ -3,7 +3,7 @@ mksourcedir # test duplicate source state entry detection cp $CHEZMOISOURCEDIR/dot_file $CHEZMOISOURCEDIR/empty_dot_file ! chezmoi verify -stderr 'duplicate source state entries' +stderr 'inconsistent state' chhome home2/user @@ -27,7 +27,7 @@ chhome home5/user # test duplicate script detection ! chezmoi verify -stderr 'duplicate source state entries' +stderr 'inconsistent state' # FIXME add more tests diff --git a/internal/cmd/testdata/scripts/modify_windows.txt b/internal/cmd/testdata/scripts/modify_windows.txt index dc6388a0c6d..aabb8b6d0a3 100644 --- a/internal/cmd/testdata/scripts/modify_windows.txt +++ b/internal/cmd/testdata/scripts/modify_windows.txt @@ -9,7 +9,7 @@ chhome home2/user # test that chezmoi apply returns an error when there are multiple modify scripts for the same target ! chezmoi apply -stderr 'duplicate source state entries' +stderr 'inconsistent state' -- golden/modified -- # modified
chore
Improve error message for inconsistent state
e2ec7c5308f589b8b4a3e9f0607d2d218dbb2c98
2022-08-19 19:40:49
Tom Payne
docs: Add instructions for using chezmoi with Watchman
false
diff --git a/assets/chezmoi.io/docs/user-guide/advanced/use-chezmoi-with-watchman.md b/assets/chezmoi.io/docs/user-guide/advanced/use-chezmoi-with-watchman.md new file mode 100644 index 00000000000..e3b43357a35 --- /dev/null +++ b/assets/chezmoi.io/docs/user-guide/advanced/use-chezmoi-with-watchman.md @@ -0,0 +1,48 @@ +# Use chezmoi with Watchman + +chezmoi can be used with [Watchman](https://facebook.github.io/watchman) to +automatically run `chezmoi apply` whenever your source state changes, but there +are some limitations because Watchman runs actions in the background without a +terminal. + +Firstly, Watchman spawns a server which runs actions when filesystems change. +This server reads its environment variables when it is started, typically on the +first invocation of the `watchman` command. If you use a password manager that +uses environment variables to persist login sessions, then you must login to +your password manager before you run the first `watchman` command, and your +session might eventually time out. + +Secondly, Watchman runs processes without a terminal, and so cannot run +interactive processes. For `chezmoi apply`, you can use the `--force` flag to +suppress prompts to overwrite files that have been modified since chezmoi last +wrote them. However, if any other part of `chezmoi apply` is interactive, for +example if your password manager prompts for a password, then it will not work +with Watchman. + +1. Tell watchman to watch your source directory: + + ```console + $ CHEZMOI_SOURCE_PATH="$(chezmoi source-path)" + $ watchman watch "${CHEZMOI_SOURCE_PATH}" + ``` + +2. Tell watchman to run `chezmoi apply --force` whenever your source directory +changes: + + ```console + $ watchman -j <<EOT + ["trigger", "${CHEZMOI_SOURCE_PATH}", { + "name": "chezmoi-apply", + "command": ["chezmoi", "apply", "--force"] + }] + EOT + ``` + +You can now make changes to your source directory and Watchman will run `chezmoi +apply --force` on each change. + +To shutdown the Watchman server, run: + + ```console + $ watchman shutdown-server + ``` diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 1abeb6a89b6..b6b63b5e43d 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -82,6 +82,7 @@ nav: - Containers and VMs: user-guide/machines/containers-and-vms.md - Advanced: - Customize your source directory: user-guide/advanced/customize-your-source-directory.md + - Use chezmoi with Watchman: user-guide/advanced/use-chezmoi-with-watchman.md - Migrate away from chezmoi: user-guide/advanced/migrate-away-from-chezmoi.md - Frequently asked questions: - Usage: user-guide/frequently-asked-questions/usage.md
docs
Add instructions for using chezmoi with Watchman
c70c753b9c7f14c0a26b85bb80ecdec34f320845
2022-02-19 20:03:02
sitiom
docs: Fix chocolatey typo
false
diff --git a/assets/chezmoi.io/docs/install.md.tmpl b/assets/chezmoi.io/docs/install.md.tmpl index 7385c6b8c02..efbb819b45a 100644 --- a/assets/chezmoi.io/docs/install.md.tmpl +++ b/assets/chezmoi.io/docs/install.md.tmpl @@ -118,7 +118,7 @@ Install chezmoi with your package manager with a single command: === "Windows" - === "Chocolately" + === "Chocolatey" ``` choco install chezmoi
docs
Fix chocolatey typo
c9ca17def6b936693d6841964f495c97517d5869
2021-12-14 21:04:51
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 0a40a5d641d..61210ea3495 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,6 @@ require ( github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/huandu/xstrings v1.3.2 // indirect github.com/kevinburke/ssh_config v1.1.0 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect github.com/microcosm-cc/bluemonday v1.0.16 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 @@ -32,7 +31,7 @@ require ( github.com/muesli/termenv v0.9.0 // indirect github.com/pelletier/go-toml v1.9.4 github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/rogpeppe/go-internal v1.8.0 + github.com/rogpeppe/go-internal v1.8.1 github.com/rs/zerolog v1.26.0 github.com/sergi/go-diff v1.1.0 github.com/shopspring/decimal v1.3.1 // indirect @@ -54,10 +53,8 @@ require ( golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b // indirect golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 - golang.org/x/sys v0.0.0-20211210111614-af8b64212486 + golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 - golang.org/x/text v0.3.7 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b howett.net/plist v1.0.0 diff --git a/go.sum b/go.sum index 1a08b07b774..8518ed77c98 100644 --- a/go.sum +++ b/go.sum @@ -39,7 +39,6 @@ cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7 cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= cloud.google.com/go/firestore v1.6.1 h1:8rBq3zRjnHx8UtBvaOWqBB1xq9jH6/wltfQLlTMh2Fw= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -350,7 +349,6 @@ github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:Fecb github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.11.0 h1:Hw/G8TtRvOElqxVIhBzXciiSTbapq8hZ2XKZsXk5ZCE= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -515,7 +513,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -585,8 +582,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.26.0 h1:ORM4ibhEZeTeQlCojCK2kPz1ogAY4bGs4tD+SaAdGaE= @@ -595,7 +592,6 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/sagikazarmark/crypt v0.3.0 h1:TV5DVog+pihN4Rr0rN1IClv4ePpkzdg9sPrw7WDofZ8= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -634,8 +630,6 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= -github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/spf13/viper v1.10.0 h1:mXH0UwHS4D2HwWZa75im4xIQynLfblmWV7qcWpfv0yk= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -929,8 +923,8 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 h1:A0Qkn7Z/n8zC1xd9LTw17AiKlBRK64tw3ejWQiEqca0= +golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= @@ -1173,7 +1167,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= diff --git a/internal/cmd/main_test.go b/internal/cmd/main_test.go index e92dbe5a731..b1971309597 100644 --- a/internal/cmd/main_test.go +++ b/internal/cmd/main_test.go @@ -19,6 +19,7 @@ import ( "testing" "time" + "github.com/rogpeppe/go-internal/imports" "github.com/rogpeppe/go-internal/testscript" "github.com/twpayne/go-vfs/v4" "github.com/twpayne/go-vfs/v4/vfst" @@ -27,27 +28,6 @@ import ( "github.com/twpayne/chezmoi/v2/internal/cmd" ) -// FIXME remove the following when -// https://github.com/rogpeppe/go-internal/pull/147 is merged. -const ( - goosList = "aix android darwin dragonfly freebsd hurd illumos ios js linux nacl netbsd openbsd plan9 solaris windows zos " - goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be loong64 mips mipsle mips64 mips64le mips64p32 mips64p32le ppc ppc64 ppc64le riscv riscv64 s390 s390x sparc sparc64 wasm " -) - -var ( - KnownOS = make(map[string]bool) - KnownArch = make(map[string]bool) -) - -func init() { - for _, v := range strings.Fields(goosList) { - KnownOS[v] = true - } - for _, v := range strings.Fields(goarchList) { - KnownArch[v] = true - } -} - var ( envConditionRx = regexp.MustCompile(`\Aenv:(\w+)\z`) umaskConditionRx = regexp.MustCompile(`\Aumask:([0-7]{3})\z`) @@ -543,20 +523,6 @@ func cmdUNIX2DOS(ts *testscript.TestScript, neg bool, args []string) { // goosCondition evaluates cond as a logical OR of GOARCHes or GOOSes enclosed // in parentheses, returning true if any of them match. func goosCondition(cond string) (result, valid bool) { - // FIXME remove the following two if statements when - // https://github.com/rogpeppe/go-internal/pull/147 is merged, and use - // github.com/rogpeppe/go-internal/imports.Known{Arch,OS} instead - if _, ok := KnownArch[cond]; ok { - result = runtime.GOARCH == cond - valid = true - return - } - if _, ok := KnownOS[cond]; ok { - result = runtime.GOOS == cond - valid = true - return - } - // Interpret the condition as a logical OR of terms in parantheses. if !strings.HasPrefix(cond, "(") || !strings.HasSuffix(cond, ")") { result = false @@ -570,8 +536,8 @@ func goosCondition(cond string) (result, valid bool) { // If any of the terms are neither known GOOSes nor GOARCHes then reject the // condition as invalid. for _, term := range terms { - if _, ok := KnownOS[term]; !ok { - if _, ok := KnownArch[term]; !ok { + if _, ok := imports.KnownOS[term]; !ok { + if _, ok := imports.KnownArch[term]; !ok { valid = false return } @@ -590,7 +556,7 @@ func goosCondition(cond string) (result, valid bool) { } } - // Otherwise, the condtion is false. + // Otherwise, the condition is false. result = false return }
chore
Update dependencies
34c93cc81fe7cd01114b90db5b058f79b4a3f134
2022-12-28 04:25:33
dependabot[bot]
chore(deps): bump dessant/lock-threads from 3.0.0 to 4.0.0
false
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 0114f4711e4..2fd2c63de68 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: action: runs-on: ubuntu-22.04 steps: - - uses: dessant/lock-threads@e460dfeb36e731f3aeb214be6b0c9a9d9a67eda6 + - uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836 with: issue-lock-reason: resolved issue-inactive-days: 7
chore
bump dessant/lock-threads from 3.0.0 to 4.0.0
dda281698671c4a4404d04b7f11461c3b4ca908a
2025-01-02 03:28:18
Tom Payne
fix: Suppress gitleaks logspam
false
diff --git a/go.mod b/go.mod index e5c59a22439..634df031652 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ require ( github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a github.com/pelletier/go-toml/v2 v2.2.3 github.com/rogpeppe/go-internal v1.13.1 + github.com/rs/zerolog v1.33.0 github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 @@ -140,7 +141,6 @@ require ( github.com/pjbgf/sha1cd v0.3.1 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.6.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect diff --git a/internal/cmd/nozerolog.go b/internal/cmd/nozerolog.go new file mode 100644 index 00000000000..7602d4f3c1a --- /dev/null +++ b/internal/cmd/nozerolog.go @@ -0,0 +1,14 @@ +package cmd + +import ( + "io" + + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" +) + +func init() { + // Suppress log output from github.com/zricethezav/gitleaks/v8. + // See https://github.com/gitleaks/gitleaks/issues/1684. + log.Logger = zerolog.New(io.Discard) +} diff --git a/internal/cmd/testdata/scripts/gitleaks.txtar b/internal/cmd/testdata/scripts/gitleaks.txtar new file mode 100644 index 00000000000..6f40d77826f --- /dev/null +++ b/internal/cmd/testdata/scripts/gitleaks.txtar @@ -0,0 +1,82 @@ +# test that there is no output when adding a complex file +exec chezmoi add $HOME${/}.karabiner.json +! stderr . +! stdout . + +-- home/user/.karabiner.json -- +{ + "profiles": [ + { + "complex_modifications": { + "rules": [ + { + "manipulators": [ + { + "description": "Change caps_lock to command+control+option+shift.", + "from": { + "key_code": "caps_lock", + "modifiers": { "optional": ["any"] } + }, + "to": [ + { + "key_code": "left_shift", + "modifiers": ["left_command", "left_control", "left_option"] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "identifiers": { + "is_keyboard": true, + "product_id": 25903, + "vendor_id": 3141 + }, + "manipulate_caps_lock_led": false, + "simple_modifications": [ + { + "from": { "key_code": "left_command" }, + "to": [{ "key_code": "left_option" }] + }, + { + "from": { "key_code": "left_option" }, + "to": [{ "key_code": "left_command" }] + } + ] + } + ], + "fn_function_keys": [ + { + "from": { "key_code": "f3" }, + "to": [{ "key_code": "mission_control" }] + }, + { + "from": { "key_code": "f4" }, + "to": [{ "key_code": "launchpad" }] + }, + { + "from": { "key_code": "f5" }, + "to": [{ "key_code": "illumination_decrement" }] + }, + { + "from": { "key_code": "f6" }, + "to": [{ "key_code": "illumination_increment" }] + }, + { + "from": { "key_code": "f9" }, + "to": [{ "consumer_key_code": "fastforward" }] + } + ], + "name": "Default profile", + "selected": true, + "virtual_hid_keyboard": { + "country_code": 0, + "keyboard_type_v2": "ansi" + } + } + ] +}
fix
Suppress gitleaks logspam
4fef1fa50f17f12fe87857a2bf4722e835e18775
2023-03-24 04:39:13
Austin Ziegler
feat: Set $CHEZMOI_VERBOSE based on --verbose
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index d6b57bdc733..d06ab4534db 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -1918,6 +1918,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error "SOURCE_DIR": templateData.SourceDir.String(), "UID": templateData.UID, "USERNAME": templateData.Username, + "VERBOSE": strconv.FormatBool(c.Verbose), "WORKING_TREE": templateData.WorkingTree.String(), } { scriptEnv = append(scriptEnv, "CHEZMOI_"+key+"="+value) diff --git a/pkg/cmd/testdata/scripts/scriptenv.txtar b/pkg/cmd/testdata/scripts/scriptenv.txtar index 94bbefd1df2..5ade0ec0336 100644 --- a/pkg/cmd/testdata/scripts/scriptenv.txtar +++ b/pkg/cmd/testdata/scripts/scriptenv.txtar @@ -6,6 +6,16 @@ stdout ^WORK=${WORK@R}$ [darwin] stdout ^CHEZMOI_OS=darwin$ [linux] stdout ^CHEZMOI_OS=linux$ stdout ^CHEZMOI_SOURCE_DIR=${CHEZMOISOURCEDIR@R}/home$ +stdout ^CHEZMOI_VERBOSE=false$ +stdout ^SCRIPTENV_KEY=SCRIPTENV_VALUE$ + +# test that chezmoi passes along --verbose in scripts +exec chezmoi apply --verbose +stdout ^WORK=${WORK@R}$ +[darwin] stdout ^CHEZMOI_OS=darwin$ +[linux] stdout ^CHEZMOI_OS=linux$ +stdout ^CHEZMOI_SOURCE_DIR=${CHEZMOISOURCEDIR@R}/home$ +stdout ^CHEZMOI_VERBOSE=true$ stdout ^SCRIPTENV_KEY=SCRIPTENV_VALUE$ -- home/user/.config/chezmoi/chezmoi.toml -- @@ -20,3 +30,4 @@ echo "WORK=${WORK}" echo "CHEZMOI_OS=${CHEZMOI_OS}" echo "CHEZMOI_SOURCE_DIR=${CHEZMOI_SOURCE_DIR}" echo "SCRIPTENV_KEY=${SCRIPTENV_KEY}" +echo "CHEZMOI_VERBOSE=${CHEZMOI_VERBOSE}"
feat
Set $CHEZMOI_VERBOSE based on --verbose
5b18fc158bc490a70b0533ca59308311e2b1ef1f
2022-12-28 04:24:28
dependabot[bot]
chore(deps): bump goreleaser/goreleaser-action from 3.2.0 to 4.1.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f791198c3b..ad3390fb497 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -210,7 +210,7 @@ jobs: make create-syso - name: build-release if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 + uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 with: version: latest args: release --skip-publish --skip-sign --snapshot --timeout=1h @@ -425,7 +425,7 @@ jobs: - name: create-syso run: | make create-syso - - uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 + - uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 with: version: latest args: release --timeout=1h
chore
bump goreleaser/goreleaser-action from 3.2.0 to 4.1.0
8a2a9da5381e9c141adb746fff6e66b01f689082
2024-01-14 00:42:36
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index e6754949183..87e563918f4 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/alecthomas/assert/v2 v2.4.1 github.com/aws/aws-sdk-go-v2 v1.24.1 github.com/aws/aws-sdk-go-v2/config v1.26.3 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.17.1 @@ -21,7 +21,7 @@ require ( github.com/coreos/go-semver v0.3.1 github.com/fsnotify/fsnotify v1.7.0 github.com/go-git/go-git/v5 v5.11.0 - github.com/google/go-github/v57 v57.0.0 + github.com/google/go-github/v58 v58.0.0 github.com/google/renameio/v2 v2.0.0 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/itchyny/gojq v0.12.14 @@ -47,7 +47,7 @@ require ( github.com/zricethezav/gitleaks/v8 v8.18.2-0.20240110190900-a59289ca9bd3 go.etcd.io/bbolt v1.3.8 golang.org/x/crypto v0.18.0 - golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 golang.org/x/oauth2 v0.16.0 golang.org/x/sync v0.6.0 golang.org/x/sys v0.16.0 @@ -120,7 +120,7 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect @@ -131,30 +131,31 @@ require ( github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pelletier/go-toml v1.9.3 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/skeema/knownhosts v1.2.1 // indirect - github.com/spf13/afero v1.6.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.8.1 // indirect - github.com/subosito/gotenv v1.2.0 // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/yuin/goldmark v1.6.0 // indirect github.com/yuin/goldmark-emoji v1.0.2 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect ) exclude ( diff --git a/go.sum b/go.sum index f70cbcd5a76..c951e2cb45f 100644 --- a/go.sum +++ b/go.sum @@ -1,55 +1,19 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/firestore v1.14.0 h1:8aLcKnMPoldYU3YHgu4t2exrKhLQkqaXAGqT0ljrFVw= +cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg= +cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= +cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w= +cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/age v1.1.1 h1:pIpO7l151hCnQ4BdyBujnGP2YlUo0uj6sAVNHGBvXHg= filippo.io/age v1.1.1/go.mod h1:l03SrzDUrBkdBx8+IILdnn2KZysqQdbEBUQ4p3sqEQE= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= @@ -68,10 +32,6 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaC github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BobuSumisu/aho-corasick v1.0.3 h1:uuf+JHwU9CHP2Vx+wAy6jcksJThhJS9ehR8a+4nPE9g= github.com/BobuSumisu/aho-corasick v1.0.3/go.mod h1:hm4jLcvZKI2vRF2WDU1N4p/jpWtpOzp3nLmi9AzX/XE= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= @@ -96,14 +56,8 @@ github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4u github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= @@ -126,8 +80,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1 h1:Sn3MAV9YeACCULaxNWWYFH1a6G4wYFwBn3/TA5MwE2Q= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1/go.mod h1:qutL00aW8GSo2D0I6UEOqMvRS3ZyuBrOC1BLe5D2jPc= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2 h1:A5sGOT/mukuU+4At1vkSIWAN8tPwPCoYZBp7aruR540= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2/go.mod h1:qutL00aW8GSo2D0I6UEOqMvRS3ZyuBrOC1BLe5D2jPc= github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 h1:dGrs+Q/WzhsiUKh82SfTVN66QzyulXuMDTV/G8ZxOac= github.com/aws/aws-sdk-go-v2/service/sso v1.18.6/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 h1:Yf2MIo9x+0tyv76GljxzqA3WtC5mw7NmazD2chwjxE4= @@ -142,10 +96,6 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.4 h1:w/jqZtC9YD4DS/Vp9GhWfWcCpuAL58oTnLoI8vE9YHU= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bradenhilton/cityhash v1.0.0 h1:1QauDCwfxwIGwO2jBTJdEBqXgfCusAgQOSgdl4RsTMI= @@ -154,8 +104,6 @@ github.com/bradenhilton/mozillainstallhash v1.0.1 h1:JVAVsItiWlLoudJX4L+tIuml+ho github.com/bradenhilton/mozillainstallhash v1.0.1/go.mod h1:J6cA36kUZrgaTkDl2bHRqI+4i2UKO1ImDB1P1x1PyOA= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/charmbracelet/bubbles v0.17.1 h1:0SIyjOnkrsfDo88YvPgAWvZMwXe26TP6drRvmkjyUu4= github.com/charmbracelet/bubbles v0.17.1/go.mod h1:9HxZWlkCqz2PRwsCbYl7a3KXvGzFaDHpYbSYMJ+nE3o= github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM= @@ -166,27 +114,13 @@ github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg= github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= @@ -200,8 +134,9 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= @@ -215,26 +150,14 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcej github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d h1:QyzYnTnPE15SQyUeqU6qLbWxMkwyAyu+vGksa0b7j00= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/semgroup v1.2.0 h1:h/OLXwEM+3NNyAdZEpMiH1OzfplU09i2qXPVThGZvyg= github.com/fatih/semgroup v1.2.0/go.mod h1:1KAD4iIYfXjE4U13B48VM4z9QUwV5Tt8O4rS879kgm8= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gitleaks/go-gitdiff v0.9.0 h1:SHAU2l0ZBEo8g82EeFewhVy81sb7JCxW76oSPtR/Nqg= github.com/gitleaks/go-gitdiff v0.9.0/go.mod h1:pKz0X4YzCKZs30BL+weqBIG7mx0jl4tF1uXV9ZyNvrA= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= @@ -247,11 +170,6 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -259,94 +177,37 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= -github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= +github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw= +github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 h1:zIaiqGYDQwa4HVx5wGRTXbx38Pqxjemn4BP98wpzpXo= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 h1:zC34cGQu69FG7qzJ3WiKW244WfhDC3xxYMeNOX2gtUQ= +github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= @@ -354,56 +215,29 @@ github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= -github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -419,19 +253,12 @@ github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGAR github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= @@ -450,12 +277,10 @@ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69 github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb h1:w1g9wNDIE/pHSTmAaUhv4TZQuPBS6GV3mMz5hkgziIU= github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -470,24 +295,11 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= -github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -495,11 +307,10 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mmcloughlin/avo v0.5.0 h1:nAco9/aI9Lg2kiuROBY6BhCI/z0t5jEvJfjWbL8qXLU= github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= @@ -513,12 +324,16 @@ github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKt github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= +github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= +github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= @@ -533,24 +348,17 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= +github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= @@ -559,12 +367,14 @@ github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.17.0 h1:ZA/7pXyjkHoK4bW4mIdnCLvL8hd+Nrbiw7Dqk7D4qUk= +github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f h1:MvTmaQdww/z0Q4wrYjDSCcZ78NoftLQyHBSLW/Cx79Y= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -577,13 +387,14 @@ github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0 github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= @@ -593,14 +404,13 @@ github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmq github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -609,8 +419,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a h1:SJy1Pu0eH1C29XwJucQo73FrleVK6t4kYz4NVhp34Yw= github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a/go.mod h1:DFSS3NAGHthKo1gTlmEcSBiZrRJXi28rLNd/1udP1c8= github.com/twpayne/go-expect v0.0.1 h1:cRJ552FIdQzs4z98Q2OLQsGLSbkB7Xpm/IU6cyQ6mUM= @@ -631,11 +441,7 @@ github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1 h1:+dBg5k7nuTE38 github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1/go.mod h1:nmuySobZb4kFgFy6BptpXp/BBw+xFSyvVPP6auoJB4k= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.7/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.5.2/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -650,35 +456,25 @@ github.com/zricethezav/gitleaks/v8 v8.18.2-0.20240110190900-a59289ca9bd3 h1:zwKx github.com/zricethezav/gitleaks/v8 v8.18.2-0.20240110190900-a59289ca9bd3/go.mod h1:8Dn6XSzCXjbkxc2e/o1M+dwIHPAoyY7HsYjLWzgg+Zs= go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0 h1:ftQ0nOOHMcbMS3KIaDQ0g5Qcd6bhaBrQT6b89DfwLTs= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= +go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= +go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= +go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= +go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= +go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= go.etcd.io/gofail v0.1.0 h1:XItAMIhOojXFQMgrxjnd2EIIHun/d5qL0Pf7FzVTkFg= go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= @@ -686,86 +482,14 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -774,79 +498,18 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -870,13 +533,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -885,187 +543,38 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -1073,33 +582,16 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE= mvdan.cc/editorconfig v0.2.0/go.mod h1:lvnnD3BNdBYkhq+B4uBuFFKatfp02eB6HixDvEz91C0= mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg= mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8= -rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/chezmoi/github.go b/internal/chezmoi/github.go index 0137d7e7c31..a152bdc3544 100644 --- a/internal/chezmoi/github.go +++ b/internal/chezmoi/github.go @@ -5,7 +5,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "golang.org/x/oauth2" ) diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index 0e0059e3d3b..8165d0c6822 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -19,7 +19,7 @@ import ( "time" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "github.com/spf13/cobra" "github.com/twpayne/go-shell" "github.com/twpayne/go-xdg/v6" diff --git a/internal/cmd/githubtemplatefuncs.go b/internal/cmd/githubtemplatefuncs.go index fb5c7551892..bde764dc29a 100644 --- a/internal/cmd/githubtemplatefuncs.go +++ b/internal/cmd/githubtemplatefuncs.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) diff --git a/internal/cmd/upgradecmd.go b/internal/cmd/upgradecmd.go index 1b5ca14db59..42fba62e2f1 100644 --- a/internal/cmd/upgradecmd.go +++ b/internal/cmd/upgradecmd.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "github.com/spf13/cobra" "github.com/twpayne/chezmoi/v2/internal/chezmoi" diff --git a/internal/cmd/upgradecmd_unix.go b/internal/cmd/upgradecmd_unix.go index 0743513b40f..21ada1b7652 100644 --- a/internal/cmd/upgradecmd_unix.go +++ b/internal/cmd/upgradecmd_unix.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" vfs "github.com/twpayne/go-vfs/v4" "github.com/twpayne/chezmoi/v2/internal/chezmoi" diff --git a/internal/cmd/upgradecmd_windows.go b/internal/cmd/upgradecmd_windows.go index ce6ca4b9cf4..de7666a2a16 100644 --- a/internal/cmd/upgradecmd_windows.go +++ b/internal/cmd/upgradecmd_windows.go @@ -11,7 +11,7 @@ import ( "path/filepath" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" vfs "github.com/twpayne/go-vfs/v4" "github.com/twpayne/chezmoi/v2/internal/chezmoi" diff --git a/internal/cmds/execute-template/main.go b/internal/cmds/execute-template/main.go index ef7a79dde4c..0f7068de945 100644 --- a/internal/cmds/execute-template/main.go +++ b/internal/cmds/execute-template/main.go @@ -16,7 +16,7 @@ import ( "text/template" "github.com/Masterminds/sprig/v3" - "github.com/google/go-github/v57/github" + "github.com/google/go-github/v58/github" "github.com/google/renameio/v2/maybe" "gopkg.in/yaml.v3"
chore
Update dependencies
82b5fa9ae2f86f739bcd5ae444a83c1686b25a8a
2023-10-10 16:09:10
Tom Payne
chore: Drop Debian 11/i386 integration test
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c28bcd155e3..7a66fe786d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,21 +85,6 @@ jobs: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} run: | ( cd assets/docker && ./test.sh archlinux ) - test-debian-i386: - needs: changes - if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - runs-on: macos-12 - steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: ~/.vagrant.d - key: ${{ runner.os }}-vagrant-debian-i386-${{ hashFiles('assets/vagrant/debian11-i386.Vagrantfile') }} - restore-keys: | - ${{ runner.os }}-vagrant-debian-i386- - - name: test - run: | - ( cd assets/vagrant && ./test.sh debian11-i386 ) test-fedora: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' @@ -375,7 +360,6 @@ jobs: - lint - test-alpine - test-archlinux - - test-debian-i386 - test-fedora - test-macos - test-oldstable-go diff --git a/Makefile b/Makefile index b251ca3d9fd..84342a01d08 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ test-docker: .PHONY: test-vagrant test-vagrant: - ( cd assets/vagrant && ./test.sh debian11-i386 freebsd13 ) + ( cd assets/vagrant && ./test.sh freebsd13 ) .PHONY: coverage-html coverage-html: coverage diff --git a/assets/vagrant/debian11-i386.Vagrantfile b/assets/vagrant/debian11-i386.Vagrantfile deleted file mode 100644 index 3e9124cfa0a..00000000000 --- a/assets/vagrant/debian11-i386.Vagrantfile +++ /dev/null @@ -1,18 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.box = "generic-x32/debian11" - config.vm.define "debian11-i386" - config.vm.hostname = "debian11-i386" - config.vm.synced_folder ".", "/chezmoi", type: "rsync" - config.vm.provision "shell", inline: <<-SHELL - DEBIAN_FRONTEND=noninteractive apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y age gpg golang unzip xz-utils zip - SHELL - config.vm.provision "shell", inline: <<-SHELL - echo CHEZMOI_GITHUB_ACCESS_TOKEN=#{ENV['CHEZMOI_GITHUB_ACCESS_TOKEN']} >> /home/vagrant/.bash_profile - echo CHEZMOI_GITHUB_TOKEN=#{ENV['CHEZMOI_GITHUB_TOKEN']} >> /home/vagrant/.bash_profile - echo GITHUB_ACCESS_TOKEN=#{ENV['GITHUB_ACCESS_TOKEN']} >> /home/vagrant/.bash_profile - echo GITHUB_TOKEN=#{ENV['GITHUB_TOKEN']} >> /home/vagrant/.bash_profile - echo export CHEZMOI_GITHUB_ACCESS_TOKEN CHEZMOI_GITHUB_TOKEN GITHUB_ACCESS_TOKEN GITHUB_TOKEN >> /home/vagrant/.bash_profile - SHELL - config.vm.provision "file", source: "assets/vagrant/debian11-i386.test-chezmoi.sh", destination: "test-chezmoi.sh" -end diff --git a/assets/vagrant/debian11-i386.test-chezmoi.sh b/assets/vagrant/debian11-i386.test-chezmoi.sh deleted file mode 100755 index 312c088049c..00000000000 --- a/assets/vagrant/debian11-i386.test-chezmoi.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -eufo pipefail - -git config --global --add safe.directory /chezmoi - -GO_VERSION=$(awk '/GO_VERSION:/ { print $2 }' /chezmoi/.github/workflows/main.yml | tr -d \') - -go get "golang.org/dl/go${GO_VERSION}" -"${HOME}/go/bin/go${GO_VERSION}" download -export PATH="${HOME}/sdk/go${GO_VERSION}/bin:${PATH}" - -cd /chezmoi - -go test ./... - -sh assets/scripts/install.sh -bin/chezmoi --version
chore
Drop Debian 11/i386 integration test
c6a4236de0776e2cbc0f05c16819e8555e7df7a7
2021-10-20 03:09:51
Tom Payne
chore: Improve internal method name
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 3c966fc08db..f86a5085e87 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -641,9 +641,9 @@ func (s *SourceState) ExecuteTemplateData(name string, data []byte) ([]byte, err return []byte(builder.String()), nil } -// Ignored returns if targetRelPath is ignored. -func (s *SourceState) Ignored(targetRelPath RelPath) bool { - return s.ignore.match(string(targetRelPath)) +// Ignore returns if targetRelPath should be ignored. +func (s *SourceState) Ignore(targetRelPath RelPath) bool { + return s.ignore.match(targetRelPath.String()) } // MinVersion returns the minimum version for which s is valid. @@ -735,7 +735,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } n := 0 for _, match := range matches { - if !s.Ignored(RelPath(match)) { + if !s.Ignore(RelPath(match)) { matches[n] = match n++ } @@ -767,7 +767,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { case info.IsDir(): da := parseDirAttr(sourceName.String()) targetRelPath := parentSourceRelPath.Dir().TargetRelPath(s.encryption.EncryptedSuffix()).Join(RelPath(da.TargetName)) - if s.Ignored(targetRelPath) { + if s.Ignore(targetRelPath) { return vfs.SkipDir } sourceStateEntry := s.newSourceStateDir(sourceRelPath, da) @@ -776,7 +776,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { case info.Mode().IsRegular(): fa := parseFileAttr(sourceName.String(), s.encryption.EncryptedSuffix()) targetRelPath := parentSourceRelPath.Dir().TargetRelPath(s.encryption.EncryptedSuffix()).Join(RelPath(fa.TargetName)) - if s.Ignored(targetRelPath) { + if s.Ignore(targetRelPath) { return nil } var sourceStateEntry SourceStateEntry @@ -802,7 +802,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { return externalRelPaths[i] < externalRelPaths[j] }) for _, externalRelPath := range externalRelPaths { - if s.Ignored(externalRelPath) { + if s.Ignore(externalRelPath) { continue } externalSourceStateEntries, err := s.readExternal(ctx, externalRelPath, s.externals[externalRelPath], options) @@ -810,7 +810,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { return err } for targetRelPath, sourceStateEntries := range externalSourceStateEntries { - if s.Ignored(targetRelPath) { + if s.Ignore(targetRelPath) { continue } allSourceStateEntries[targetRelPath] = append(allSourceStateEntries[targetRelPath], sourceStateEntries...) @@ -819,7 +819,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { // Remove all ignored targets. for targetRelPath := range allSourceStateEntries { - if s.Ignored(targetRelPath) { + if s.Ignore(targetRelPath) { delete(allSourceStateEntries, targetRelPath) } } @@ -848,7 +848,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { if _, ok := allSourceStateEntries[destEntryRelPath]; ok { continue } - if s.Ignored(destEntryRelPath) { + if s.Ignore(destEntryRelPath) { continue } allSourceStateEntries[destEntryRelPath] = append(allSourceStateEntries[destEntryRelPath], &SourceStateRemove{ @@ -1628,7 +1628,7 @@ func (s *SourceState) readExternalArchive(ctx context.Context, externalRelPath R } targetRelPath := externalRelPath.Join(RelPath(name)) - if s.Ignored(targetRelPath) { + if s.Ignore(targetRelPath) { return nil } diff --git a/internal/cmd/unmanagedcmd.go b/internal/cmd/unmanagedcmd.go index 3103dce9ed3..62dadca615f 100644 --- a/internal/cmd/unmanagedcmd.go +++ b/internal/cmd/unmanagedcmd.go @@ -34,7 +34,7 @@ func (c *Config) runUnmanagedCmd(cmd *cobra.Command, args []string, sourceState } targeRelPath := destAbsPath.MustTrimDirPrefix(c.DestDirAbsPath) _, managed := sourceState.Entry(targeRelPath) - ignored := sourceState.Ignored(targeRelPath) + ignored := sourceState.Ignore(targeRelPath) if !managed && !ignored { builder.WriteString(string(targeRelPath) + "\n") }
chore
Improve internal method name
5f4f20a800bb4fed9a779cfb22757f57171fa715
2022-12-27 22:11:51
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index de709cef078..da392b3b872 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,11 @@ module github.com/twpayne/chezmoi/v2 go 1.18 require ( - filippo.io/age v1.0.0 + filippo.io/age v1.1.1 github.com/Masterminds/sprig/v3 v3.2.3 github.com/aws/aws-sdk-go-v2 v1.17.3 github.com/aws/aws-sdk-go-v2/config v1.18.7 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.10 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.11 github.com/bmatcuk/doublestar/v4 v4.4.0 github.com/bradenhilton/mozillainstallhash v1.0.0 github.com/charmbracelet/bubbles v0.14.0 diff --git a/go.sum b/go.sum index 643c907020c..02b8092ea6f 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ= -filippo.io/age v1.0.0 h1:V6q14n0mqYU3qKFkZ6oOaF9oXneOviS3ubXsSVBRSzc= -filippo.io/age v1.0.0/go.mod h1:PaX+Si/Sd5G8LgfCwldsSba3H1DDQZhIhFGkhbHaBq8= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/age v1.1.1 h1:pIpO7l151hCnQ4BdyBujnGP2YlUo0uj6sAVNHGBvXHg= +filippo.io/age v1.1.1/go.mod h1:l03SrzDUrBkdBx8+IILdnn2KZysqQdbEBUQ4p3sqEQE= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= @@ -41,8 +41,8 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 h1:KeTxcGdNnQudb46oOl4d90f2I33 github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28/go.mod h1:yRZVr/iT0AqyHeep00SZ4YfBAKojXz08w3XMBscdi0c= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 h1:5C6XgTViSb0bunmU57b3CT+MhxULqHH2721FVA+/kDM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21/go.mod h1:lRToEJsn+DRA9lW4O9L9+/3hjTkUzlzyzHqn8MTds5k= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.10 h1:6obimjQAiRlEUZT7a2Q1ikH7ck4cPO3phGz4wqI5f2w= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.10/go.mod h1:jAeo/PdIJZuDSwsvxJS94G4d6h8tStj7WXVuKwLHWU8= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.11 h1:77V7vnw/NC4DORHVgA97+Ky2p1ri0+ZVYXh6ordUZU0= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.16.11/go.mod h1:jAeo/PdIJZuDSwsvxJS94G4d6h8tStj7WXVuKwLHWU8= github.com/aws/aws-sdk-go-v2/service/sso v1.11.28 h1:gItLq3zBYyRDPmqAClgzTH8PBjDQGeyptYGHIwtYYNA= github.com/aws/aws-sdk-go-v2/service/sso v1.11.28/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 h1:KCacyVSs/wlcPGx37hcbT3IGYO8P8Jx+TgSDhAXtQMY=
chore
Update dependencies
e6151cf2ae9ae9915c4b98397842bfbbcf999057
2022-09-12 22:54:21
Tom Payne
chore: Clean up files
false
diff --git a/pkg/chezmoi/erroronwritesystem.go b/pkg/chezmoi/erroronwritesystem.go index ec3c93c3f42..9d637e27a45 100644 --- a/pkg/chezmoi/erroronwritesystem.go +++ b/pkg/chezmoi/erroronwritesystem.go @@ -14,7 +14,8 @@ type ErrorOnWriteSystem struct { err error } -// NewErrorOnWriteSystem returns a new ErrorOnWriteSystem that wraps fs. +// NewErrorOnWriteSystem returns a new ErrorOnWriteSystem that wraps fs and +// returns err on any write operation. func NewErrorOnWriteSystem(system System, err error) *ErrorOnWriteSystem { return &ErrorOnWriteSystem{ system: system, diff --git a/pkg/chezmoi/gitdiffsystem.go b/pkg/chezmoi/gitdiffsystem.go index 9ec869bd485..a82081add5e 100644 --- a/pkg/chezmoi/gitdiffsystem.go +++ b/pkg/chezmoi/gitdiffsystem.go @@ -252,6 +252,7 @@ func (s *GitDiffSystem) encodeDiff(absPath AbsPath, toData []byte, toMode fs.Fil var fromMode fs.FileMode switch fromInfo, err := s.system.Lstat(absPath); { case errors.Is(err, fs.ErrNotExist): + // Leave fromData and fromMode at their zero values. case err != nil: return err case fromInfo.Mode().IsRegular(): @@ -289,10 +290,12 @@ func (s *GitDiffSystem) encodeDiff(absPath AbsPath, toData []byte, toMode fs.Fil fromData, toData = toData, fromData fromMode, toMode = toMode, fromMode } + diffPatch, err := DiffPatch(s.trimPrefix(absPath), fromData, fromMode, toData, toMode) if err != nil { return err } + return s.unifiedEncoder.Encode(diffPatch) } diff --git a/pkg/chezmoi/hexbytes.go b/pkg/chezmoi/hexbytes.go index 084556dc23d..67dd115bdea 100644 --- a/pkg/chezmoi/hexbytes.go +++ b/pkg/chezmoi/hexbytes.go @@ -29,8 +29,7 @@ func (h *HexBytes) UnmarshalText(text []byte) error { return nil } result := make([]byte, hex.DecodedLen(len(text))) - _, err := hex.Decode(result, text) - if err != nil { + if _, err := hex.Decode(result, text); err != nil { return err } *h = result
chore
Clean up files
087513abadbabca4cb86b964d3a2a63c7ee3e6fe
2024-01-10 19:20:54
Tom Payne
chore: Pin mkdocs version
false
diff --git a/assets/chezmoi.io/requirements.txt b/assets/chezmoi.io/requirements.txt index 7bae2fa6725..e3532cbe474 100644 --- a/assets/chezmoi.io/requirements.txt +++ b/assets/chezmoi.io/requirements.txt @@ -1,2 +1,3 @@ +mkdocs==1.5.3 mkdocs-material==9.5.3 mkdocs-mermaid2-plugin==1.1.1
chore
Pin mkdocs version
c67b4ecddc6224ad16c4acd92998c65fd3fc89f6
2021-11-30 04:35:59
Tom Payne
chore: Add CHEZMOI_GITHUB_TOKEN env var as a GitHub token source
false
diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index ad6856b8026..9e6ec884035 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -1774,10 +1774,10 @@ will call the GitHub API to determine if there is a new version of chezmoi available, and if so, download and attempt to install it in the same way as chezmoi was previously installed. -If the any of the `$CHEZMOI_GITHUB_ACCESS_TOKEN`, `$GITHUB_ACCESS_TOKEN`, or -`$GITHUB_TOKEN` environment variables are set, then the first value found will -be used to authenticate requests to the GitHub API, otherwise unauthenticated -requests are used which are subject to stricter [rate +If the any of the `$CHEZMOI_GITHUB_ACCESS_TOKEN`, `$CHEZMOI_GITHUB_TOKEN`, +`$GITHUB_ACCESS_TOKEN`, or `$GITHUB_TOKEN` environment variables are set, then +the first value found will be used to authenticate requests to the GitHub API, +otherwise unauthenticated requests are used which are subject to stricter [rate limiting](https://developer.github.com/v3/#rate-limiting). Unauthenticated requests should be sufficient for most cases. diff --git a/internal/cmd/util.go b/internal/cmd/util.go index 3a74b8e1dc2..8bc0e01faec 100644 --- a/internal/cmd/util.go +++ b/internal/cmd/util.go @@ -77,6 +77,7 @@ func firstNonEmptyString(ss ...string) string { func newGitHubClient(ctx context.Context, httpClient *http.Client) *github.Client { for _, key := range []string{ "CHEZMOI_GITHUB_ACCESS_TOKEN", + "CHEZMOI_GITHUB_TOKEN", "GITHUB_ACCESS_TOKEN", "GITHUB_TOKEN", } {
chore
Add CHEZMOI_GITHUB_TOKEN env var as a GitHub token source
1f9a7bbadd54358fab7b4f9203a62c7913265108
2023-07-21 03:16:10
Tom Payne
feat: Add .chezmoiexternals directory for multiple externals
false
diff --git a/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternals.md b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternals.md new file mode 100644 index 00000000000..d3cef028856 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternals.md @@ -0,0 +1,4 @@ +# `.chezmoiexternals` + +If a directory called `.chezmoiexternals` exists, then all files in this +directory are treated as `.chezmoiexternal.<format>` files. diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 89739d276a3..674c56fa805 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -119,6 +119,7 @@ nav: - .chezmoi.&lt;format&gt;.tmpl: reference/special-files-and-directories/chezmoi-format-tmpl.md - .chezmoidata.&lt;format&gt;: reference/special-files-and-directories/chezmoidata-format.md - .chezmoiexternal.&lt;format&gt;: reference/special-files-and-directories/chezmoiexternal-format.md + - .chezmoiexternals: reference/special-files-and-directories/chezmoiexternals.md - .chezmoiignore: reference/special-files-and-directories/chezmoiignore.md - .chezmoiremove: reference/special-files-and-directories/chezmoiremove.md - .chezmoiroot: reference/special-files-and-directories/chezmoiroot.md diff --git a/pkg/chezmoi/chezmoi.go b/pkg/chezmoi/chezmoi.go index f7972da52ba..900aae192ed 100644 --- a/pkg/chezmoi/chezmoi.go +++ b/pkg/chezmoi/chezmoi.go @@ -75,6 +75,7 @@ const ( VersionName = Prefix + "version" dataName = Prefix + "data" externalName = Prefix + "external" + externalsDirName = Prefix + "externals" ignoreName = Prefix + "ignore" removeName = Prefix + "remove" scriptsDirName = Prefix + "scripts" @@ -115,6 +116,7 @@ var knownPrefixedFiles = newSet( var knownPrefixedDirs = newSet( TemplatesDirName, dataName, + externalsDirName, scriptsDirName, ) diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index f2b7b4c48d4..b80118f8b67 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -940,7 +940,13 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { case s.templateDataOnly: return nil case isPrefixDotFormat(fileInfo.Name(), externalName) || isPrefixDotFormatDotTmpl(fileInfo.Name(), externalName): - return s.addExternal(sourceAbsPath) + parentAbsPath, _ := sourceAbsPath.Split() + return s.addExternal(sourceAbsPath, parentAbsPath) + case fileInfo.Name() == externalsDirName: + if err := s.addExternalDir(ctx, sourceAbsPath); err != nil { + return err + } + return vfs.SkipDir case fileInfo.Name() == ignoreName || fileInfo.Name() == ignoreName+TemplateSuffix: return s.addPatterns(s.ignore, sourceAbsPath, parentSourceRelPath) case fileInfo.Name() == removeName || fileInfo.Name() == removeName+TemplateSuffix: @@ -1287,9 +1293,7 @@ func (s *SourceState) TemplateData() map[string]any { } // addExternal adds external source entries to s. -func (s *SourceState) addExternal(sourceAbsPath AbsPath) error { - parentAbsPath, _ := sourceAbsPath.Split() - +func (s *SourceState) addExternal(sourceAbsPath, parentAbsPath AbsPath) error { parentRelPath, err := parentAbsPath.TrimDirPrefix(s.sourceDirAbsPath) if err != nil { return err @@ -1325,6 +1329,40 @@ func (s *SourceState) addExternal(sourceAbsPath AbsPath) error { return nil } +// addExternalDir adds all externals in externalsDirAbsPath to s. +func (s *SourceState) addExternalDir(ctx context.Context, externalsDirAbsPath AbsPath) error { + walkFunc := func(ctx context.Context, externalAbsPath AbsPath, fileInfo fs.FileInfo, err error) error { + if externalAbsPath == externalsDirAbsPath { + return nil + } + if err == nil && fileInfo.Mode().Type() == fs.ModeSymlink { + fileInfo, err = s.system.Stat(externalAbsPath) + } + switch { + case err != nil: + return err + case strings.HasPrefix(fileInfo.Name(), Prefix): + return fmt.Errorf("%s: not allowed in %s directory", externalAbsPath, externalsDirName) + case strings.HasPrefix(fileInfo.Name(), ignorePrefix): + if fileInfo.IsDir() { + return vfs.SkipDir + } + return nil + case fileInfo.Mode().IsRegular(): + parentAbsPath, _ := externalAbsPath.Split() + return s.addExternal(externalAbsPath, parentAbsPath.TrimSuffix("/").Dir()) + case fileInfo.IsDir(): + return nil + default: + return &unsupportedFileTypeError{ + absPath: externalAbsPath, + mode: fileInfo.Mode(), + } + } + } + return concurrentWalkSourceDir(ctx, s.system, externalsDirAbsPath, walkFunc) +} + // addPatterns executes the template at sourceAbsPath, interprets the result as // a list of patterns, and adds all patterns found to patternSet. func (s *SourceState) addPatterns( diff --git a/pkg/cmd/testdata/scripts/external.txtar b/pkg/cmd/testdata/scripts/external.txtar index 8b1360c34a3..b04383b090f 100644 --- a/pkg/cmd/testdata/scripts/external.txtar +++ b/pkg/cmd/testdata/scripts/external.txtar @@ -110,6 +110,12 @@ exec chezmoi apply [umask:002] cmpmod 775 $HOME/.file [umask:022] cmpmod 755 $HOME/.file +chhome home14/user + +# test that chezmoi reads external files from the .chezmoiexternal directory +exec chezmoi apply +cmp $HOME/.file golden/dir/file + -- archive/dir/file -- # contents of dir/file -- golden/.file -- @@ -156,6 +162,12 @@ exec chezmoi apply path = "dir/file" executable = true stripComponents = 1 +-- home14/user/.local/share/chezmoi/.chezmoiexternals/external.toml -- +[".file"] + type = "archive-file" + url = "{{ env "HTTPD_URL" }}/archive.tar.gz" + path = "dir/file" + stripComponents = 1 -- home2/user/.local/share/chezmoi/.chezmoiexternal.toml -- [".file"] type = "file"
feat
Add .chezmoiexternals directory for multiple externals
c5f30c8ce33e35542235ec74dabaea148213bd2c
2023-08-02 14:11:47
Mike
feat: Add support for Doppler
false
diff --git a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml index c5f9e55ff43..49f7e664180 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml +++ b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml @@ -147,6 +147,19 @@ sections: type: bool default: '`true`' description: Show script contents + doppler: + args: + type: '[]string' + description: Extra args to Doppler CLI command + command: + default: '`doppler`' + description: Doppler CLI command + config: + type: string + description: Default config (aka environment) if none is specified + project: + type: string + description: Default project name if none is specified edit: apply: type: bool diff --git a/assets/chezmoi.io/docs/reference/templates/doppler/doppler.md b/assets/chezmoi.io/docs/reference/templates/doppler/doppler.md new file mode 100644 index 00000000000..671bbb5a6f5 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/doppler/doppler.md @@ -0,0 +1,15 @@ +# `doppler` *key* [*project* [*config*]] + +`doppler` returns the secret for the specified project and configuration +from [Doppler](https://www.doppler.com) using `doppler secrets download --json --no-file`. + +If either of *project* or *config* are empty or +omitted, then chezmoi will use the value from the +`doppler.project` and +`doppler.config` config variables if they are set and not empty. + +!!! example + + ``` + {{ doppler "SECRET_NAME" "project_name" "configuration_name" }} + ``` diff --git a/assets/chezmoi.io/docs/reference/templates/doppler/dopplerProjectJson.md b/assets/chezmoi.io/docs/reference/templates/doppler/dopplerProjectJson.md new file mode 100644 index 00000000000..35d0a03dd2d --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/doppler/dopplerProjectJson.md @@ -0,0 +1,16 @@ +# `dopplerProjectJson` [*project* [*config*]] + +`dopplerProjectJson` returns the secret for the specified project and configuration +from [Doppler](https://www.doppler.com) using `doppler secrets download --json --no-file` +as `json` structured data. + +If either of *project* or *config* are empty or +omitted, then chezmoi will use the value from the +`doppler.project` and +`doppler.config` config variables if they are set and not empty. + +!!! example + + ``` + {{ (dopplerProjectJson "project_name" "configuration_name").SECRET_NAME }} + ``` diff --git a/assets/chezmoi.io/docs/reference/templates/doppler/index.md b/assets/chezmoi.io/docs/reference/templates/doppler/index.md new file mode 100644 index 00000000000..5b389e5fb89 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/doppler/index.md @@ -0,0 +1,9 @@ +# Doppler + +chezmoi includes support for [Doppler](https://www.doppler.com) using the `doppler` +CLI to expose data through the `doppler` and `dopplerProjectJson` +template functions. + +!!! warning + + Doppler is in beta and chezmoi's interface to it may change. diff --git a/assets/chezmoi.io/docs/user-guide/password-managers/custom.md b/assets/chezmoi.io/docs/user-guide/password-managers/custom.md index 2b3b3bbd4ee..582f6e3a04c 100644 --- a/assets/chezmoi.io/docs/user-guide/password-managers/custom.md +++ b/assets/chezmoi.io/docs/user-guide/password-managers/custom.md @@ -7,14 +7,15 @@ configuration file. You can then invoke this command with the `secret` and output respectively. All of the above secret managers can be supported in this way: -| Secret Manager | `secret.command` | Template skeleton | -| ----------------- | ---------------- | -------------------------------------------------- | -| 1Password | `op` | `{{ secretJSON "get" "item" "$ID" }}` | -| Bitwarden | `bw` | `{{ secretJSON "get" "$ID" }}` | -| HashiCorp Vault | `vault` | `{{ secretJSON "kv" "get" "-format=json" "$ID" }}` | -| HCP Vault Secrets | `vlt` | `{{ secret "secrets" "get" "--plaintext" "$ID }}` | -| LastPass | `lpass` | `{{ secretJSON "show" "--json" "$ID" }}` | -| KeePassXC | `keepassxc-cli` | Not possible (interactive command only) | -| Keeper | `keeper` | `{{ secretJSON "get" "--format=json" "$ID" }}` | -| pass | `pass` | `{{ secret "show" "$ID" }}` | -| passhole | `ph` | `{{ secret "$ID" "password" }}` | +| Secret Manager | `secret.command` | Template skeleton | +| ----------------- | ---------------- | ---------------------------------------------------------------- | +| 1Password | `op` | `{{ secretJSON "get" "item" "$ID" }}` | +| Bitwarden | `bw` | `{{ secretJSON "get" "$ID" }}` | +| Doppler | `doppler` | `{{ secretJSON "secrets" "download" "--json" "--no-file" }}` | +| HashiCorp Vault | `vault` | `{{ secretJSON "kv" "get" "-format=json" "$ID" }}` | +| HCP Vault Secrets | `vlt` | `{{ secret "secrets" "get" "--plaintext" "$ID }}` | +| LastPass | `lpass` | `{{ secretJSON "show" "--json" "$ID" }}` | +| KeePassXC | `keepassxc-cli` | Not possible (interactive command only) | +| Keeper | `keeper` | `{{ secretJSON "get" "--format=json" "$ID" }}` | +| pass | `pass` | `{{ secret "show" "$ID" }}` | +| passhole | `ph` | `{{ secret "$ID" "password" }}` | diff --git a/assets/chezmoi.io/docs/user-guide/password-managers/doppler.md b/assets/chezmoi.io/docs/user-guide/password-managers/doppler.md new file mode 100644 index 00000000000..62823ac8fe6 --- /dev/null +++ b/assets/chezmoi.io/docs/user-guide/password-managers/doppler.md @@ -0,0 +1,58 @@ +# Doppler + +chezmoi includes support for [Doppler](https://www.doppler.com) using the `doppler` +CLI to expose data through the `doppler` and `dopplerProjectJson` +template functions. + +!!! warning + + Doppler is in beta and chezmoi's interface to it may change. + Note: Doppler only supports secrets in the `UPPER_SNAKE_CASE` format. + +Log in using: + +```console +$ doppler login +``` + +It is now possible to interact with the `doppler` CLI in two different, but similar, ways. +Both make use of the command `doppler secrets download --json --no-file` behind the scenes +but present a different experience. + +The `doppler` function is used in the following way: +``` +{{ doppler "SECRET_NAME" "project name" "config" }} +``` + +All secrets from the specified project/config combination are cached for subsequent access and +will not requery the `doppler` CLI for another secret in the same project/config. +This caching mechanism enhances performance and reduces unnecessary CLI calls. + +The `dopplerProjectJson` presents the secrets as `json` structured data and is used in the following +way: +``` +{{ (dopplerProjectJson "project" "config").PASSWORD }} +``` + +Additionally one can set the default values for the project and +config (aka environment) in your config file, for example: + +```toml title="~/.config/chezmoi/chezmoi.toml" +[doppler] + project = "my-project" + config = "dev" +``` +With these default values, you can omit them in the call to both `doppler` and `dopplerProjectJson`, +for example: +``` +{{ doppler "SECRET_NAME" }} +{{ dopplerProjectJson.SECRET_NAME }} +``` + +It is important to note that neither of the above parse any individual secret as `json`. +This can be achieved by using the `fromJson` function, for example: +``` +{{ (doppler "SECRET_NAME" | fromJson).created_by.email_address }} +{{ (dopplerProjectJson.SECRET_NAME | fromJson).created_by.email_address }} +``` +Obviously the secret would have to be saved in `json` format for this to work as expected. diff --git a/assets/chezmoi.io/docs/what-does-chezmoi-do.md b/assets/chezmoi.io/docs/what-does-chezmoi-do.md index 46bc4817d1d..e214c1189fb 100644 --- a/assets/chezmoi.io/docs/what-does-chezmoi-do.md +++ b/assets/chezmoi.io/docs/what-does-chezmoi-do.md @@ -46,8 +46,8 @@ format of your choice. chezmoi can retrieve secrets from Manager](https://aws.amazon.com/secrets-manager/), [Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/general/), [Bitwarden](https://bitwarden.com/), [Dashlane](https://www.dashlane.com/), -[gopass](https://www.gopass.pw/), [HCP Vault -Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets), +[Doppler](https://www.doppler.com), [gopass](https://www.gopass.pw/), +[HCP Vault Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets), [KeePassXC](https://keepassxc.org/), [Keeper](https://www.keepersecurity.com/), [LastPass](https://lastpass.com/), [pass](https://www.passwordstore.org/), [passhole](https://github.com/Evidlo/passhole), diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index b741a68b2c1..f3415a88a47 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -251,6 +251,10 @@ nav: - reference/templates/dashlane-functions/index.md - dashlaneNote: reference/templates/dashlane-functions/dashlaneNote.md - dashlanePassword: reference/templates/dashlane-functions/dashlanePassword.md + - Doppler functions: + - reference/templates/doppler-functions/index.md + - doppler: reference/templates/doppler-functions/doppler.md + - dopplerProjectJson: reference/templates/doppler-functions/dopplerProjectJson.md - ejson functions: - reference/templates/ejson-functions/index.md - ejsonDecrypt: reference/templates/ejson-functions/ejsonDecrypt.md diff --git a/internal/cmd/config.go b/internal/cmd/config.go index ee74d5410ec..7fa56d818af 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -128,6 +128,7 @@ type ConfigFile struct { AzureKeyVault azureKeyVaultConfig `json:"azureKeyVault" mapstructure:"azureKeyVault" yaml:"azureKeyVault"` Bitwarden bitwardenConfig `json:"bitwarden" mapstructure:"bitwarden" yaml:"bitwarden"` Dashlane dashlaneConfig `json:"dashlane" mapstructure:"dashlane" yaml:"dashlane"` + Doppler dopplerConfig `json:"doppler" mapstructure:"doppler" yaml:"doppler"` Ejson ejsonConfig `json:"ejson" mapstructure:"ejson" yaml:"ejson"` Gopass gopassConfig `json:"gopass" mapstructure:"gopass" yaml:"gopass"` HCPVaultSecrets hcpVaultSecretConfig `json:"hcpVaultSecrets" mapstructure:"hcpVaultSecrets" yaml:"hcpVaultSecrets"` @@ -396,6 +397,8 @@ func newConfig(options ...configOption) (*Config, error) { "dashlanePassword": c.dashlanePasswordTemplateFunc, "decrypt": c.decryptTemplateFunc, "deleteValueAtPath": c.deleteValueAtPathTemplateFunc, + "doppler": c.dopplerTemplateFunc, + "dopplerProjectJson": c.dopplerProjectJSONTemplateFunc, "ejsonDecrypt": c.ejsonDecryptTemplateFunc, "ejsonDecryptWithKey": c.ejsonDecryptWithKeyTemplateFunc, "encrypt": c.encryptTemplateFunc, @@ -2588,6 +2591,9 @@ func newConfigFile(bds *xdg.BaseDirectorySpecification) ConfigFile { Dashlane: dashlaneConfig{ Command: "dcli", }, + Doppler: dopplerConfig{ + Command: "doppler", + }, Ejson: ejsonConfig{ KeyDir: firstNonEmptyString(os.Getenv("EJSON_KEYDIR"), "/opt/ejson/keys"), }, diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index 68d7ee8f152..15076deb41b 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -313,6 +313,14 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { versionArgs: []string{"--version"}, versionRx: regexp.MustCompile(`^(\d+\.\d+\.\d+)`), }, + &binaryCheck{ + name: "doppler-command", + binaryname: c.Doppler.Command, + ifNotSet: checkResultWarning, + ifNotExist: checkResultInfo, + versionArgs: []string{"--version"}, + versionRx: regexp.MustCompile(`^v(\d+\.\d+\.\d+)`), + }, &binaryCheck{ name: "gopass-command", binaryname: c.Gopass.Command, diff --git a/internal/cmd/dopplertemplatefuncs.go b/internal/cmd/dopplertemplatefuncs.go new file mode 100644 index 00000000000..d1e3ad31e6a --- /dev/null +++ b/internal/cmd/dopplertemplatefuncs.go @@ -0,0 +1,111 @@ +package cmd + +import ( + "encoding/json" + "fmt" + "os" + "os/exec" + "strings" + + "golang.org/x/exp/slices" + + "github.com/twpayne/chezmoi/v2/internal/chezmoilog" +) + +type dopplerConfig struct { + Command string `json:"command" mapstructure:"command" yaml:"command"` + Args []string `json:"args" mapstructure:"args" yaml:"args"` + Project string `json:"project" mapstructure:"project" yaml:"project"` + Config string `json:"config" mapstructure:"config" yaml:"config"` + outputCache map[string][]byte +} + +func (c *Config) dopplerTemplateFunc(key string, additionalArgs ...string) any { + if len(additionalArgs) > 2 { + // Add one to the number of received arguments as the key + // is the first argument. + panic(fmt.Errorf("expected 1 to 3 arguments, got %d", len(additionalArgs)+1)) + } + + args := c.appendDopplerAdditionalArgs( + []string{"secrets", "download", "--json", "--no-file"}, + additionalArgs, + ) + + data, err := c.dopplerOutput(args) + if err != nil { + panic(err) + } + var value map[string]any + if err := json.Unmarshal(data, &value); err != nil { + panic(err) + } + + secret, ok := value[key] + if !ok { + panic(fmt.Errorf("could not find requested secret: %s", key)) + } + + return secret +} + +func (c *Config) dopplerProjectJSONTemplateFunc(additionalArgs ...string) any { + if len(additionalArgs) > 2 { + panic(fmt.Errorf("expected 0 to 2 arguments, got %d", len(additionalArgs))) + } + args := c.appendDopplerAdditionalArgs( + []string{"secrets", "download", "--json", "--no-file"}, + additionalArgs, + ) + + data, err := c.dopplerOutput(args) + if err != nil { + panic(err) + } + var value any + if err := json.Unmarshal(data, &value); err != nil { + panic(err) + } + return value +} + +func (c *Config) appendDopplerAdditionalArgs( + args, additionalArgs []string, +) []string { + if len(additionalArgs) > 0 && additionalArgs[0] != "" { + args = append(args, "--project", additionalArgs[0]) + } else if c.Doppler.Project != "" { + args = append(args, "--project", c.Doppler.Project) + } + if len(additionalArgs) > 1 && additionalArgs[1] != "" { + args = append(args, "--config", additionalArgs[1]) + } else if c.Doppler.Config != "" { + args = append(args, "--config", c.Doppler.Config) + } + + return args +} + +func (c *Config) dopplerOutput(args []string) ([]byte, error) { + args = append(slices.Clone(c.Doppler.Args), args...) + key := strings.Join(args, "\x00") + if data, ok := c.Doppler.outputCache[key]; ok { + return data, nil + } + cmd := exec.Command(c.Doppler.Command, args...) //nolint:gosec + // Always run the doppler command in the destination path because doppler uses + // relative paths to find its .doppler.json config file. + cmd.Dir = c.DestDirAbsPath.String() + cmd.Stdin = os.Stdin + cmd.Stderr = os.Stderr + output, err := chezmoilog.LogCmdOutput(cmd) + if err != nil { + return nil, newCmdOutputError(cmd, output, err) + } + + if c.Doppler.outputCache == nil { + c.Doppler.outputCache = make(map[string][]byte) + } + c.Doppler.outputCache[key] = output + return output, nil +} diff --git a/internal/cmd/testdata/scripts/doctor_unix.txtar b/internal/cmd/testdata/scripts/doctor_unix.txtar index 9600d37fabd..c499e7bf529 100644 --- a/internal/cmd/testdata/scripts/doctor_unix.txtar +++ b/internal/cmd/testdata/scripts/doctor_unix.txtar @@ -3,6 +3,7 @@ chmod 755 bin/age chmod 755 bin/bw chmod 755 bin/dcli +chmod 755 bin/doppler chmod 755 bin/git chmod 755 bin/gopass chmod 755 bin/gpg @@ -48,6 +49,7 @@ stdout '^ok\s+pinentry-command\s+' stdout '^ok\s+1password-command\s+' stdout '^ok\s+bitwarden-command\s+' stdout '^ok\s+dashlane-command\s+' +stdout '^ok\s+doppler-command\s+' stdout '^ok\s+gopass-command\s+' stdout '^ok\s+keepassxc-command\s+' stdout '^info\s+keepassxc-db\s+' @@ -93,6 +95,10 @@ echo "1.12.1" #!/bin/sh echo 1.0.0 +-- bin/doppler -- +#!/bin/sh + +echo "v3.65.1" -- bin/git -- #!/bin/sh diff --git a/internal/cmd/testdata/scripts/doppler.txtar b/internal/cmd/testdata/scripts/doppler.txtar new file mode 100644 index 00000000000..24cf5832d86 --- /dev/null +++ b/internal/cmd/testdata/scripts/doppler.txtar @@ -0,0 +1,151 @@ +[!windows] chmod 755 bin/doppler +[windows] unix2dos bin/doppler.cmd + +# test doppler template function (global configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD_123"}}' +stdout ^staplebatteryhorsecorrect$ + +# test doppler template function with project and config arguments (supplied configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD" "project" "config" }}' +stdout ^correcthorsebatterystaple$ + +# test doppler template function with empty project and config arguments (global configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD" "" "" }}' +stdout ^correcthorsebatterystaple$ + +# test dopplerProjectJson template function with project and config arguments (supplied configuration) +exec chezmoi execute-template '{{ (dopplerProjectJson "project" "config").PASSWORD_123 }}' +stdout ^staplebatteryhorsecorrect$ + +# test dopplerProjectJson template function with JSON secret piped to fromJson function, project and config arguments +exec chezmoi execute-template '{{ ((dopplerProjectJson "project" "config").JSON_SECRET | fromJson).created_by.email }}' +stdout ^user@example\.com$ + +# test dopplerProjectJson template function with project and empty config arguments (global configuration) +exec chezmoi execute-template '{{ (dopplerProjectJson "project" "").PASSWORD }}' +stdout ^correcthorsebatterystaple$ + +# test dopplerProjectJson template function with empty project and empty config arguments (global configuration) +exec chezmoi execute-template '{{ (dopplerProjectJson "" "").PASSWORD }}' +stdout ^correcthorsebatterystaple$ + +# test dopplerProjectJson template function without project and config arguments (global configuration) +exec chezmoi execute-template '{{ dopplerProjectJson.PASSWORD }}' +stdout ^correcthorsebatterystaple$ + +chhome home3/user + +# test doppler template function with default project and config arguments (chezmoi configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD" }}' +stdout ^default-project-password$ + +# test doppler template function with project and default config arguments (chezmoi configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD" "other-project" }}' +stdout ^other-project-password$ + +# test doppler template function with project and default config arguments (supplied configuration) +exec chezmoi execute-template '{{ doppler "PASSWORD" "project" "config" }}' +stdout ^correcthorsebatterystaple$ + +# test dopplerProjectJson template function with project and default config arguments (chezmoi configuration) +exec chezmoi execute-template '{{ (dopplerProjectJson "default-project").DOPPLER_CONFIG }}' +stdout ^default-config$ + +# test dopplerProjectJson template function with default project and config arguments (chezmoi configuration) +exec chezmoi execute-template '{{ (dopplerProjectJson).DOPPLER_PROJECT }}' +stdout ^default-project$ + +-- bin/doppler -- +#!/bin/sh + +case "$*" in +"secrets download --json --no-file --project project --config config"|"secrets download --json --no-file --project project"|"secrets download --json --no-file") + cat <<EOF +{ + "DOPPLER_CONFIG": "config", + "DOPPLER_ENVIRONMENT": "config", + "DOPPLER_PROJECT": "project", + "PASSWORD": "correcthorsebatterystaple", + "PASSWORD_123": "staplebatteryhorsecorrect", + "JSON_SECRET": "{\n \"created_at\": \"2023-06-09T13:14:28.140Z\",\n \"created_by\": {\n \"email\": \"[email protected]\",\n \"name\": \"example\",\n \"type\": \"TYPE_USER\"\n },\n \"latest_version\": \"2\",\n \"name\": \"password\"\n}" +} +EOF + ;; +"secrets download --json --no-file --project default-project --config default-config") + cat <<EOF +{ + "DOPPLER_CONFIG": "default-config", + "DOPPLER_ENVIRONMENT": "default-config", + "DOPPLER_PROJECT": "default-project", + "PASSWORD": "default-project-password" +} +EOF + ;; +"secrets download --json --no-file --project other-project --config default-config") + cat <<EOF +{ + "DOPPLER_CONFIG": "default-config", + "DOPPLER_ENVIRONMENT": "default-config", + "DOPPLER_PROJECT": "other-project", + "PASSWORD": "other-project-password" +} +EOF + ;; +*) + echo "$*: unknown command" + exit 1 + ;; +esac +-- bin/doppler.cmd -- +@echo off +IF "%*" == "secrets download --json --no-file --project project --config config" ( + goto download-project +) ELSE IF "%*" == "secrets download --json --no-file --project project" ( + goto download-project +) ELSE IF "%*" == "secrets download --json --no-file" ( + goto download-project +) ELSE IF "%*" == "secrets download --json --no-file --project default-project --config default-config" ( + goto download-default-project +) ELSE IF "%*" == "secrets download --json --no-file --project other-project --config default-config" ( + goto download-other-project +) ELSE ( + echo unknown command: $* + exit /b 1 +) + +exit /b 0 + +:download-project +echo.{ +echo. "DOPPLER_CONFIG": "config", +echo. "DOPPLER_ENVIRONMENT": "config", +echo. "DOPPLER_PROJECT": "project", +echo. "PASSWORD": "correcthorsebatterystaple", +echo. "PASSWORD_123": "staplebatteryhorsecorrect", +echo. "JSON_SECRET": "{\n \"created_at\": \"2023-06-09T13:14:28.140Z\",\n \"created_by\": {\n \"email\": \"[email protected]\",\n \"name\": \"example\",\n \"type\": \"TYPE_USER\"\n },\n \"latest_version\": \"2\",\n \"name\": \"password\"\n}" +echo.} +exit /b 0 + +:download-default-project +echo.{ +echo. "DOPPLER_CONFIG": "default-config", +echo. "DOPPLER_ENVIRONMENT": "default-config", +echo. "DOPPLER_PROJECT": "default-project", +echo. "PASSWORD": "default-project-password" +echo.} +exit /b 0 + +:download-other-project +echo.{ +echo. "DOPPLER_CONFIG": "default-config", +echo. "DOPPLER_ENVIRONMENT": "default-config", +echo. "DOPPLER_PROJECT": "other-project", +echo. "PASSWORD": "other-project-password" +echo.} +exit /b 0 + +-- home/user/.keep -- +-- home3/user/.config/chezmoi/chezmoi.toml -- +[doppler] + project = "default-project" + config = "default-config"
feat
Add support for Doppler
28c2718a7779858fdf60347fdcad8d6d72e44046
2022-03-07 06:00:23
Tom Payne
docs: Add license to website
false
diff --git a/assets/chezmoi.io/docs/license.md b/assets/chezmoi.io/docs/license.md new file mode 100644 index 00000000000..2440a17e87d --- /dev/null +++ b/assets/chezmoi.io/docs/license.md @@ -0,0 +1,23 @@ +# License + +The MIT License (MIT) + +Copyright (c) 2018-2022 Tom Payne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 04b82377073..0dd14c1b90d 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -121,6 +121,7 @@ nav: - help: reference/commands/help.md - init: reference/commands/init.md - import: reference/commands/import.md + - license: reference/commands/license.md - list: reference/commands/list.md - manage: reference/commands/manage.md - managed: reference/commands/managed.md @@ -199,6 +200,7 @@ nav: - Articles, podcasts, and videos: links/articles-podcasts-and-videos.md - Dotfile repos using chezmoi: links/dotfile-repos-using-chezmoi.md - Related software: links/related-software.md +- License: license.md markdown_extensions: - admonition
docs
Add license to website
ca8142f0f0b448503abf56982aa2041c4ba9d534
2022-11-15 05:16:31
Tom Payne
fix: Make re-add command respect --interactive flag
false
diff --git a/pkg/cmd/readdcmd.go b/pkg/cmd/readdcmd.go index eb4c8deaf0f..89db13d9e97 100644 --- a/pkg/cmd/readdcmd.go +++ b/pkg/cmd/readdcmd.go @@ -2,6 +2,7 @@ package cmd import ( "bytes" + "fmt" "io/fs" "sort" @@ -49,6 +50,7 @@ func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *che }) sort.Sort(targetRelPaths) +TARGETRELPATH: for _, targetRelPath := range targetRelPaths { sourceStateFile, ok := sourceStateEntries[targetRelPath].(*chezmoi.SourceStateFile) if !ok { @@ -93,6 +95,41 @@ func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *che continue } + if c.interactive { + prompt := fmt.Sprintf("Re-add %s", targetRelPath) + var choices []string + if actualContents != nil || targetContents != nil { + choices = append(choices, "diff") + } + choices = append(choices, choicesYesNoAllQuit...) + FOR: + for { + switch choice, err := c.promptChoice(prompt, choices); { + case err != nil: + return err + case choice == "diff": + if err := c.diffFile( + targetRelPath, + targetContents, targetStateFile.Perm(c.Umask), + actualContents, actualStateFile.Perm(), + ); err != nil { + return err + } + case choice == "yes": + break FOR + case choice == "no": + continue TARGETRELPATH + case choice == "all": + c.interactive = false + break FOR + case choice == "quit": + return chezmoi.ExitCodeError(0) + default: + panic(fmt.Sprintf("%s: unexpected choice", choice)) + } + } + } + destAbsPathInfos := map[chezmoi.AbsPath]fs.FileInfo{ destAbsPath: destAbsPathInfo, }
fix
Make re-add command respect --interactive flag
bf8a1850824a3f4e5faa34ba28968521bddbbf54
2021-11-03 01:07:05
Tom Payne
fix: Make chezmoi add command respect .chezmoiignore
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 5717d631fe9..c83388cd19a 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -259,6 +259,10 @@ DESTABSPATH: } targetRelPath := destAbsPath.MustTrimDirPrefix(s.destDirAbsPath) + if s.Ignore(targetRelPath) { + continue + } + // Find the target's parent directory in the source state. var parentSourceRelPath SourceRelPath if targetParentRelPath := targetRelPath.Dir(); targetParentRelPath == DotRelPath { diff --git a/internal/cmd/testdata/scripts/add.txt b/internal/cmd/testdata/scripts/add.txt index bbb43482be7..6685a13d5cd 100644 --- a/internal/cmd/testdata/scripts/add.txt +++ b/internal/cmd/testdata/scripts/add.txt @@ -57,5 +57,19 @@ chezmoi add $HOME${/}.dir ! exists $CHEZMOISOURCEDIR/dot_dir/.keep exists $CHEZMOISOURCEDIR/dot_dir/empty_subdir/.keep ! exists $CHEZMOISOURCEDIR/dot_dir/non_empty_subdir/.keep + +chhome home3/user + +# test that chezmoi add respects .chezmoiignore +chezmoi add $HOME${/}.dir +exists $CHEZMOISOURCEDIR/dot_dir/file +! exists $CHEZMOISOURCEDIR/dot_dir/ignore + -- home2/user/.dir/non_empty_subdir/file -- # contents of .dir/non_empty_subdir/file +-- home3/user/.local/share/chezmoi/.chezmoiignore -- +**/ignore +-- home3/user/.dir/file -- +# contents of .dir/file +-- home3/user/.dir/ignore -- +# contents of .dir/ignore
fix
Make chezmoi add command respect .chezmoiignore
ced12b81b493670520b177dcc62de2c67172858d
2023-03-24 05:12:26
Tom Payne
fix: Only set $CHEZMOI_VERBOSE when --verbose is set
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index d06ab4534db..9bef2200699 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -1918,11 +1918,13 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error "SOURCE_DIR": templateData.SourceDir.String(), "UID": templateData.UID, "USERNAME": templateData.Username, - "VERBOSE": strconv.FormatBool(c.Verbose), "WORKING_TREE": templateData.WorkingTree.String(), } { scriptEnv = append(scriptEnv, "CHEZMOI_"+key+"="+value) } + if c.Verbose { + scriptEnv = append(scriptEnv, "CHEZMOI_VERBOSE=1") + } for groupKey, group := range map[string]map[string]any{ "KERNEL": templateData.Kernel, "OS_RELEASE": templateData.OSRelease, diff --git a/pkg/cmd/testdata/scripts/scriptenv.txtar b/pkg/cmd/testdata/scripts/scriptenv.txtar index 5ade0ec0336..083f73c462a 100644 --- a/pkg/cmd/testdata/scripts/scriptenv.txtar +++ b/pkg/cmd/testdata/scripts/scriptenv.txtar @@ -6,7 +6,7 @@ stdout ^WORK=${WORK@R}$ [darwin] stdout ^CHEZMOI_OS=darwin$ [linux] stdout ^CHEZMOI_OS=linux$ stdout ^CHEZMOI_SOURCE_DIR=${CHEZMOISOURCEDIR@R}/home$ -stdout ^CHEZMOI_VERBOSE=false$ +stdout ^CHEZMOI_VERBOSE=$ stdout ^SCRIPTENV_KEY=SCRIPTENV_VALUE$ # test that chezmoi passes along --verbose in scripts @@ -15,7 +15,7 @@ stdout ^WORK=${WORK@R}$ [darwin] stdout ^CHEZMOI_OS=darwin$ [linux] stdout ^CHEZMOI_OS=linux$ stdout ^CHEZMOI_SOURCE_DIR=${CHEZMOISOURCEDIR@R}/home$ -stdout ^CHEZMOI_VERBOSE=true$ +stdout ^CHEZMOI_VERBOSE=1$ stdout ^SCRIPTENV_KEY=SCRIPTENV_VALUE$ -- home/user/.config/chezmoi/chezmoi.toml --
fix
Only set $CHEZMOI_VERBOSE when --verbose is set
707dc200e2e105af7675ac87dee9608aab09e03a
2024-12-21 18:46:19
Tom Payne
chore: Use new standard library instead of RelPaths
false
diff --git a/internal/chezmoi/relpath.go b/internal/chezmoi/relpath.go index 6ddcb817042..544a0a9441c 100644 --- a/internal/chezmoi/relpath.go +++ b/internal/chezmoi/relpath.go @@ -1,6 +1,7 @@ package chezmoi import ( + "cmp" "path" "strings" ) @@ -15,13 +16,6 @@ type RelPath struct { relPath string } -// RelPaths is a slice of RelPaths that implements sort.Interface. -type RelPaths []RelPath - -func (ps RelPaths) Len() int { return len(ps) } -func (ps RelPaths) Less(i, j int) bool { return ps[i].Less(ps[j]) } -func (ps RelPaths) Swap(i, j int) { ps[i], ps[j] = ps[j], ps[i] } - // NewRelPath returns a new RelPath. func NewRelPath(relPath string) RelPath { return RelPath{ @@ -84,11 +78,6 @@ func (p RelPath) Len() int { return len(p.relPath) } -// Less returns true if p is less than other. -func (p RelPath) Less(other RelPath) bool { - return p.relPath < other.relPath -} - // MarshalText implements encoding.TextMarshaler.MarshalText. func (p RelPath) MarshalText() ([]byte, error) { return []byte(p.relPath), nil @@ -139,3 +128,8 @@ func (p RelPath) TrimDirPrefix(dirPrefix RelPath) (RelPath, error) { } return p.Slice(dirPrefix.Len()+1, p.Len()), nil } + +// CompareRelPaths compares a and b. +func CompareRelPaths(a, b RelPath) int { + return cmp.Compare(a.relPath, b.relPath) +} diff --git a/internal/chezmoi/sourcerelpath.go b/internal/chezmoi/sourcerelpath.go index 3e26e4fd503..c2283b629fc 100644 --- a/internal/chezmoi/sourcerelpath.go +++ b/internal/chezmoi/sourcerelpath.go @@ -56,11 +56,6 @@ func (p SourceRelPath) Join(sourceRelPaths ...SourceRelPath) SourceRelPath { } } -// Less returns true if p is less than other. -func (p SourceRelPath) Less(other SourceRelPath) bool { - return p.relPath.Less(other.relPath) -} - // MarshalText implements encoding.TextMarshaler.MarshalText. func (p SourceRelPath) MarshalText() ([]byte, error) { return []byte(p.relPath.String()), nil diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index b9faa9b6182..b3ebd31c798 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -24,7 +24,6 @@ import ( "regexp" "runtime" "slices" - "sort" "strings" "sync" "syscall" @@ -847,9 +846,9 @@ func (s *SourceState) Ignore(targetRelPath RelPath) bool { } // Ignored returns all ignored RelPaths. -func (s *SourceState) Ignored() RelPaths { - relPaths := RelPaths(s.ignoredRelPaths.Elements()) - sort.Sort(relPaths) +func (s *SourceState) Ignored() []RelPath { + relPaths := s.ignoredRelPaths.Elements() + slices.SortFunc(relPaths, CompareRelPaths) return relPaths } @@ -868,7 +867,7 @@ func (s *SourceState) PostApply( targetSystem System, persistentState PersistentState, targetDirAbsPath AbsPath, - targetRelPaths RelPaths, + targetRelPaths []RelPath, ) error { // Remove empty directories with the remove_ attribute. This assumes that // targetRelPaths is already sorted and iterates in reverse order so that @@ -1073,11 +1072,11 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } // Read externals. - externalRelPaths := make(RelPaths, 0, len(s.externals)) + externalRelPaths := make([]RelPath, 0, len(s.externals)) for externalRelPath := range s.externals { externalRelPaths = append(externalRelPaths, externalRelPath) } - sort.Sort(externalRelPaths) + slices.SortFunc(externalRelPaths, CompareRelPaths) for _, externalRelPath := range externalRelPaths { if s.Ignore(externalRelPath) { continue @@ -1182,7 +1181,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } // Generate SourceStateCommands for git-repo externals. - var gitRepoExternalRelPaths RelPaths + var gitRepoExternalRelPaths []RelPath for externalRelPath, externals := range s.externals { if s.Ignore(externalRelPath) { continue @@ -1193,7 +1192,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } } } - sort.Sort(gitRepoExternalRelPaths) + slices.SortFunc(gitRepoExternalRelPaths, CompareRelPaths) for _, externalRelPath := range gitRepoExternalRelPaths { for _, external := range s.externals[externalRelPath] { destAbsPath := s.destDirAbsPath.Join(externalRelPath) @@ -1258,11 +1257,11 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { // Check for inconsistent source entries. Iterate over the target names in // order so that any error is deterministic. - targetRelPaths := make(RelPaths, 0, len(allSourceStateEntries)) + targetRelPaths := make([]RelPath, 0, len(allSourceStateEntries)) for targetRelPath := range allSourceStateEntries { targetRelPaths = append(targetRelPaths, targetRelPath) } - sort.Sort(targetRelPaths) + slices.SortFunc(targetRelPaths, CompareRelPaths) errs := make([]error, 0, len(targetRelPaths)) for _, targetRelPath := range targetRelPaths { sourceStateEntries := allSourceStateEntries[targetRelPath] @@ -1299,17 +1298,11 @@ func (s *SourceState) TargetRelPaths() []RelPath { for targetRelPath := range entries { targetRelPaths = append(targetRelPaths, targetRelPath) } - sort.Slice(targetRelPaths, func(i, j int) bool { - orderI := entries[targetRelPaths[i]].Order() - orderJ := entries[targetRelPaths[j]].Order() - switch { - case orderI < orderJ: - return true - case orderI == orderJ: - return targetRelPaths[i].Less(targetRelPaths[j]) - default: - return false + slices.SortFunc(targetRelPaths, func(a, b RelPath) int { + if compare := cmp.Compare(entries[a].Order(), entries[b].Order()); compare != 0 { + return compare } + return CompareRelPaths(a, b) }) return targetRelPaths } diff --git a/internal/chezmoi/sourcestatetreenode.go b/internal/chezmoi/sourcestatetreenode.go index 02ebe31912f..a2a0d0219b1 100644 --- a/internal/chezmoi/sourcestatetreenode.go +++ b/internal/chezmoi/sourcestatetreenode.go @@ -6,7 +6,6 @@ import ( "io/fs" "maps" "slices" - "sort" ) // A sourceStateEntryTreeNode is a node in a tree of SourceStateEntries. @@ -67,8 +66,8 @@ func (n *sourceStateEntryTreeNode) forEachNode(targetRelPath RelPath, f func(Rel return err } - childrenByRelPath := RelPaths(slices.Collect(maps.Keys(n.children))) - sort.Sort(childrenByRelPath) + childrenByRelPath := slices.Collect(maps.Keys(n.children)) + slices.SortFunc(childrenByRelPath, CompareRelPaths) for _, childRelPath := range childrenByRelPath { child := n.children[childRelPath] if err := child.forEachNode(targetRelPath.Join(childRelPath), f); err != nil { diff --git a/internal/cmd/chattrcmd.go b/internal/cmd/chattrcmd.go index ab07694debd..0017b8ac466 100644 --- a/internal/cmd/chattrcmd.go +++ b/internal/cmd/chattrcmd.go @@ -2,7 +2,7 @@ package cmd import ( "fmt" - "sort" + "slices" "strings" "github.com/spf13/cobra" @@ -159,12 +159,10 @@ func (c *Config) runChattrCmd(cmd *cobra.Command, args []string, sourceState *ch return err } - // Sort targets in reverse so we update children before their parent + // Visit targets in reverse so we update children before their parent // directories. - sort.Sort(sort.Reverse(targetRelPaths)) - encryptedSuffix := sourceState.Encryption().EncryptedSuffix() - for _, targetRelPath := range targetRelPaths { + for _, targetRelPath := range slices.Backward(targetRelPaths) { sourceStateEntry := sourceState.MustEntry(targetRelPath) sourceRelPath := sourceStateEntry.SourceRelPath() parentSourceRelPath, fileSourceRelPath := sourceRelPath.Split() diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 666dccd3097..7cb3c70e644 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -23,7 +23,6 @@ import ( "runtime" "runtime/pprof" "slices" - "sort" "strconv" "strings" "text/template" @@ -660,7 +659,7 @@ func (c *Config) applyArgs( return err } - var targetRelPaths chezmoi.RelPaths + var targetRelPaths []chezmoi.RelPath switch { case len(args) == 0: targetRelPaths = sourceState.TargetRelPaths() @@ -2633,8 +2632,8 @@ func (c *Config) targetRelPaths( sourceState *chezmoi.SourceState, args []string, options targetRelPathsOptions, -) (chezmoi.RelPaths, error) { - targetRelPaths := make(chezmoi.RelPaths, 0, len(args)) +) ([]chezmoi.RelPath, error) { + targetRelPaths := make([]chezmoi.RelPath, 0, len(args)) for _, arg := range args { argAbsPath, err := chezmoi.NewAbsPathFromExtPath(arg, c.homeDirAbsPath) if err != nil { @@ -2680,7 +2679,7 @@ func (c *Config) targetRelPaths( } // Sort and de-duplicate targetRelPaths in place. - sort.Sort(targetRelPaths) + slices.SortFunc(targetRelPaths, chezmoi.CompareRelPaths) n := 1 for i := 1; i < len(targetRelPaths); i++ { if targetRelPaths[i] != targetRelPaths[i-1] { diff --git a/internal/cmd/managedcmd.go b/internal/cmd/managedcmd.go index 3d4064a8f2b..adef747c647 100644 --- a/internal/cmd/managedcmd.go +++ b/internal/cmd/managedcmd.go @@ -43,7 +43,7 @@ func (c *Config) newManagedCmd() *cobra.Command { func (c *Config) runManagedCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { // Build queued relPaths. When there are no arguments, start from root, // otherwise start from arguments. - var relPaths chezmoi.RelPaths + var relPaths []chezmoi.RelPath for _, arg := range args { if absPath, err := chezmoi.NormalizePath(arg); err != nil { return err diff --git a/internal/cmd/readdcmd.go b/internal/cmd/readdcmd.go index 69b539bc291..bc9d97e87d8 100644 --- a/internal/cmd/readdcmd.go +++ b/internal/cmd/readdcmd.go @@ -5,7 +5,7 @@ import ( "fmt" "io/fs" "runtime" - "sort" + "slices" "time" "github.com/spf13/cobra" @@ -59,7 +59,7 @@ func (c *Config) newReAddCmd() *cobra.Command { } func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { - var targetRelPaths chezmoi.RelPaths + var targetRelPaths []chezmoi.RelPath sourceStateEntries := make(map[chezmoi.RelPath]chezmoi.SourceStateEntry) if len(args) == 0 { _ = sourceState.ForEach( @@ -81,7 +81,7 @@ func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *che sourceStateEntries[targetRelPath] = sourceState.Get(targetRelPath) } } - sort.Sort(targetRelPaths) + slices.SortFunc(targetRelPaths, chezmoi.CompareRelPaths) TARGET_REL_PATH: for _, targetRelPath := range targetRelPaths {
chore
Use new standard library instead of RelPaths
7323f6a3182c40f001cc414309af14bc5b8f77f4
2023-12-20 16:06:53
Tom Payne
feat: Extend remove_ attribute to directories
false
diff --git a/assets/chezmoi.io/docs/reference/source-state-attributes.md b/assets/chezmoi.io/docs/reference/source-state-attributes.md index 233bca2e6dc..6ac1811a291 100644 --- a/assets/chezmoi.io/docs/reference/source-state-attributes.md +++ b/assets/chezmoi.io/docs/reference/source-state-attributes.md @@ -42,8 +42,7 @@ prefixes is important. | Target type | Source type | Allowed prefixes in order | Allowed suffixes | | ---------------- | ----------- | --------------------------------------------------------------------------------- | ---------------- | -| Directory | Directory | `external_`, `exact_`, `private_`, `readonly_`, `dot_` | *none* | -| Remove directory | Directory | `remove_`, `dot_` | *none* | +| Directory | Directory | `remove_`, `external_`, `exact_`, `private_`, `readonly_`, `dot_` | *none* | | Regular file | File | `encrypted_`, `private_`, `readonly_`, `empty_`, `executable_`, `dot_` | `.tmpl` | | Create file | File | `create_`, `encrypted_`, `private_`, `readonly_`, `empty_`, `executable_`, `dot_` | `.tmpl` | | Modify file | File | `modify_`, `encrypted_`, `private_`, `readonly_`, `executable_`, `dot_` | `.tmpl` | diff --git a/internal/chezmoi/attr.go b/internal/chezmoi/attr.go index 960a572ce48..530700eed52 100644 --- a/internal/chezmoi/attr.go +++ b/internal/chezmoi/attr.go @@ -7,21 +7,6 @@ import ( "github.com/rs/zerolog" ) -// A SourceDirTargetType is the type of a target represented by a directory in -// the source state. -type SourceDirTargetType int - -// Source dir types. -const ( - SourceDirTypeDir SourceDirTargetType = iota - SourceDirTypeRemove -) - -var sourceDirTypeStrs = map[SourceDirTargetType]string{ - SourceDirTypeDir: "dir", - SourceDirTypeRemove: "remove", -} - // A SourceFileTargetType is a the type of a target represented by a file in the // source state. A file in the source state can represent a file, script, or // symlink in the target state. @@ -70,11 +55,11 @@ const ( // DirAttr holds attributes parsed from a source directory name. type DirAttr struct { TargetName string - Type SourceDirTargetType Exact bool External bool Private bool ReadOnly bool + Remove bool } // A FileAttr holds attributes parsed from a source file name. @@ -92,25 +77,12 @@ type FileAttr struct { } // parseDirAttr parses a single directory name in the source state. -func parseDirAttr(sourceName string) DirAttr { - var ( - sourceDirType = SourceDirTypeDir - name = sourceName - external = false - exact = false - private = false - readOnly = false - ) - switch { - case strings.HasPrefix(name, removePrefix): - sourceDirType = SourceDirTypeRemove - name = name[len(removePrefix):] - default: - name, external = strings.CutPrefix(name, externalPrefix) - name, exact = strings.CutPrefix(name, exactPrefix) - name, private = strings.CutPrefix(name, privatePrefix) - name, readOnly = strings.CutPrefix(name, readOnlyPrefix) - } +func parseDirAttr(name string) DirAttr { + name, remove := strings.CutPrefix(name, removePrefix) + name, external := strings.CutPrefix(name, externalPrefix) + name, exact := strings.CutPrefix(name, exactPrefix) + name, private := strings.CutPrefix(name, privatePrefix) + name, readOnly := strings.CutPrefix(name, readOnlyPrefix) switch { case strings.HasPrefix(name, dotPrefix): name = "." + name[len(dotPrefix):] @@ -119,11 +91,11 @@ func parseDirAttr(sourceName string) DirAttr { } return DirAttr{ TargetName: name, - Type: sourceDirType, Exact: exact, External: external, Private: private, ReadOnly: readOnly, + Remove: remove, } } @@ -131,33 +103,31 @@ func parseDirAttr(sourceName string) DirAttr { // github.com/rs/zerolog.ObjectMarshaler.MarshalZerologObject. func (da DirAttr) MarshalZerologObject(e *zerolog.Event) { e.Str("TargetName", da.TargetName) - e.Str("Type", sourceDirTypeStrs[da.Type]) e.Bool("Exact", da.Exact) e.Bool("External", da.External) e.Bool("Private", da.Private) e.Bool("ReadOnly", da.ReadOnly) + e.Bool("Remove", da.Remove) } // SourceName returns da's source name. func (da DirAttr) SourceName() string { sourceName := "" - switch da.Type { - case SourceDirTypeDir: - if da.External { - sourceName += externalPrefix - } - if da.Exact { - sourceName += exactPrefix - } - if da.Private { - sourceName += privatePrefix - } - if da.ReadOnly { - sourceName += readOnlyPrefix - } - case SourceDirTypeRemove: + if da.Remove { sourceName += removePrefix } + if da.External { + sourceName += externalPrefix + } + if da.Exact { + sourceName += exactPrefix + } + if da.Private { + sourceName += privatePrefix + } + if da.ReadOnly { + sourceName += readOnlyPrefix + } switch { case strings.HasPrefix(da.TargetName, "."): sourceName += dotPrefix + da.TargetName[len("."):] diff --git a/internal/chezmoi/attr_test.go b/internal/chezmoi/attr_test.go index 11c7530becc..c4ecb5f1295 100644 --- a/internal/chezmoi/attr_test.go +++ b/internal/chezmoi/attr_test.go @@ -24,26 +24,19 @@ func TestDirAttr(t *testing.T) { "symlink_dir", } assert.NoError(t, combinator.Generate(&dirAttrs, struct { - Type SourceDirTargetType TargetName []string Exact []bool External []bool Private []bool ReadOnly []bool + Remove []bool }{ - Type: SourceDirTypeDir, TargetName: targetNames, Exact: []bool{false, true}, External: []bool{false, true}, Private: []bool{false, true}, ReadOnly: []bool{false, true}, - })) - assert.NoError(t, combinator.Generate(&dirAttrs, struct { - Type SourceDirTargetType - TargetName []string - }{ - Type: SourceDirTypeRemove, - TargetName: targetNames, + Remove: []bool{false, true}, })) for _, dirAttr := range dirAttrs { actualSourceName := dirAttr.SourceName() diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index e36c5a2ed70..c02e4d0883a 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -1020,7 +1020,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { allSourceStateEntriesMu.Unlock() return fs.SkipDir } - if sourceStateDir.Attr.Type == SourceDirTypeRemove { + if sourceStateDir.Attr.Remove { s.Lock() s.removeDirs[targetRelPath] = struct{}{} s.Unlock() diff --git a/internal/cmd/chattrcmd.go b/internal/cmd/chattrcmd.go index 0714da52c3b..f22986ff45d 100644 --- a/internal/cmd/chattrcmd.go +++ b/internal/cmd/chattrcmd.go @@ -42,14 +42,6 @@ const ( orderModifierSetAfter orderModifier = 2 ) -type sourceDirTypeModifier int - -const ( - sourceDirTypeModifierLeaveUnchanged sourceDirTypeModifier = iota - sourceDirTypeModifierSetRemove - sourceDirTypeModifierClearRemove -) - type sourceFileTypeModifier int const ( @@ -67,7 +59,6 @@ const ( ) type modifier struct { - sourceDirType sourceDirTypeModifier sourceFileType sourceFileTypeModifier condition conditionModifier empty boolModifier @@ -78,6 +69,7 @@ type modifier struct { order orderModifier private boolModifier readOnly boolModifier + remove boolModifier template boolModifier } @@ -308,25 +300,6 @@ func (m orderModifier) modify(order chezmoi.ScriptOrder) chezmoi.ScriptOrder { } } -// modify returns the modified value of type. -func (m sourceDirTypeModifier) modify( - sourceDirType chezmoi.SourceDirTargetType, -) chezmoi.SourceDirTargetType { - switch m { - case sourceDirTypeModifierLeaveUnchanged: - return sourceDirType - case sourceDirTypeModifierSetRemove: - return chezmoi.SourceDirTypeRemove - case sourceDirTypeModifierClearRemove: - if sourceDirType == chezmoi.SourceDirTypeRemove { - return chezmoi.SourceDirTypeDir - } - return sourceDirType - default: - panic(fmt.Sprintf("%d: unknown type modifier", m)) - } -} - // modify returns the modified value of type. func (m sourceFileTypeModifier) modify( sourceFileType chezmoi.SourceFileTargetType, @@ -462,10 +435,10 @@ func parseModifier(s string) (*modifier, error) { case "remove": switch bm { case boolModifierClear: - m.sourceDirType = sourceDirTypeModifierClearRemove + m.remove = bm m.sourceFileType = sourceFileTypeModifierClearRemove case boolModifierSet: - m.sourceDirType = sourceDirTypeModifierSetRemove + m.remove = bm m.sourceFileType = sourceFileTypeModifierSetRemove } case "script": @@ -493,23 +466,13 @@ func parseModifier(s string) (*modifier, error) { // modifyDirAttr returns the modified value of dirAttr. func (m *modifier) modifyDirAttr(dirAttr chezmoi.DirAttr) chezmoi.DirAttr { - switch m.sourceDirType.modify(dirAttr.Type) { - case chezmoi.SourceDirTypeDir: - return chezmoi.DirAttr{ - TargetName: dirAttr.TargetName, - Type: chezmoi.SourceDirTypeDir, - Exact: m.exact.modify(dirAttr.Exact), - External: m.external.modify(dirAttr.External), - Private: m.private.modify(dirAttr.Private), - ReadOnly: m.readOnly.modify(dirAttr.ReadOnly), - } - case chezmoi.SourceDirTypeRemove: - return chezmoi.DirAttr{ - TargetName: dirAttr.TargetName, - Type: chezmoi.SourceDirTypeRemove, - } - default: - panic(fmt.Sprintf("%d: unknown source dir type", dirAttr.Type)) + return chezmoi.DirAttr{ + TargetName: dirAttr.TargetName, + Exact: m.exact.modify(dirAttr.Exact), + External: m.external.modify(dirAttr.External), + Private: m.private.modify(dirAttr.Private), + ReadOnly: m.readOnly.modify(dirAttr.ReadOnly), + Remove: m.remove.modify(dirAttr.Remove), } } diff --git a/internal/cmd/testdata/scripts/chattr.txtar b/internal/cmd/testdata/scripts/chattr.txtar index fca9d05ae06..78ba3bf0691 100644 --- a/internal/cmd/testdata/scripts/chattr.txtar +++ b/internal/cmd/testdata/scripts/chattr.txtar @@ -91,16 +91,11 @@ exists $CHEZMOISOURCEDIR/exact_readonly_dot_dir # test that chezmoi chattr remove sets the remove attribute on a directory exec chezmoi chattr remove $HOME${/}.dir ! exists $CHEZMOISOURCEDIR/exact_readonly_dot_dir -exists $CHEZMOISOURCEDIR/remove_dot_dir +exists $CHEZMOISOURCEDIR/remove_exact_readonly_dot_dir # test that chezmoi chattr noremove removes the remove attribute on a directory exec chezmoi chattr noremove $HOME${/}.dir -! exists $CHEZMOISOURCEDIR/remove_dot_dir -exists $CHEZMOISOURCEDIR/dot_dir - -# test that chezmoi chattr exact,readonly sets the exact and readonly attributes on a directory -exec chezmoi chattr exact,readonly $HOME${/}.dir -! exists $CHEZMOISOURCEDIR/dot_dir +! exists $CHEZMOISOURCEDIR/remove_exact_readonly_dot_dir exists $CHEZMOISOURCEDIR/exact_readonly_dot_dir # test that chezmoi chattr +t sets the template attribute on a symlink diff --git a/internal/cmd/testdata/scripts/issue3415.txtar b/internal/cmd/testdata/scripts/issue3415.txtar new file mode 100644 index 00000000000..1eb1ae204ce --- /dev/null +++ b/internal/cmd/testdata/scripts/issue3415.txtar @@ -0,0 +1,26 @@ +# test that chezmoi apply does not remove remove_ directories if they are not empty +exec chezmoi apply +exists $HOME/.dir/file + +# test that chezmoi apply does remove remove_ directories if they are empty +rm $HOME/.dir/file +exec chezmoi apply +! exists $HOME/.dir + +chhome home2/user + +# test that chezmoi apply does not remove remove_ directories if they are not empty, recursively +exec chezmoi apply +exists $HOME/.dir/subdir/file + +# test that chezmoi apply does remove remove_ directories if they are empty, recursively +rm $HOME/.dir/subdir/file +exec chezmoi apply +! exists $HOME/.dir + +-- home/user/.dir/file -- +# contents of .dir/file +-- home/user/.local/share/chezmoi/remove_dot_dir/.keep -- +-- home2/user/.dir/subdir/file -- +# contents of .dir/subdir/file +-- home2/user/.local/share/chezmoi/remove_dot_dir/remove_subdir/.keep --
feat
Extend remove_ attribute to directories
9574f0a24b6851ad69d9925b0d0d7bc5029a1eed
2022-10-20 03:24:14
Tom Payne
chore: Use generic function
false
diff --git a/pkg/chezmoi/boltpersistentstate.go b/pkg/chezmoi/boltpersistentstate.go index 2de52e38391..33b9aa2343c 100644 --- a/pkg/chezmoi/boltpersistentstate.go +++ b/pkg/chezmoi/boltpersistentstate.go @@ -7,6 +7,7 @@ import ( "time" "go.etcd.io/bbolt" + "golang.org/x/exp/slices" ) // A BoltPersistentStateMode is a mode for opening a PersistentState. @@ -86,7 +87,7 @@ func (b *BoltPersistentState) CopyTo(p PersistentState) error { return b.db.View(func(tx *bbolt.Tx) error { return tx.ForEach(func(bucket []byte, b *bbolt.Bucket) error { return b.ForEach(func(key, value []byte) error { - return p.Set(copyByteSlice(bucket), copyByteSlice(key), copyByteSlice(value)) + return p.Set(slices.Clone(bucket), slices.Clone(key), slices.Clone(value)) }) }) }) @@ -170,7 +171,7 @@ func (b *BoltPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) return nil } return b.ForEach(func(k, v []byte) error { - return fn(copyByteSlice(k), copyByteSlice(v)) + return fn(slices.Clone(k), slices.Clone(v)) }) }) } @@ -190,7 +191,7 @@ func (b *BoltPersistentState) Get(bucket, key []byte) ([]byte, error) { if b == nil { return nil } - value = copyByteSlice(b.Get(key)) + value = slices.Clone(b.Get(key)) return nil }); err != nil { return nil, err @@ -230,13 +231,3 @@ func (b *BoltPersistentState) open() error { b.db = db return nil } - -// copyByteSlice returns a copy of value. -func copyByteSlice(value []byte) []byte { - if value == nil { - return nil - } - result := make([]byte, len(value)) - copy(result, value) - return result -}
chore
Use generic function
ac82b2a2f11b2a40708f68436253eec451e13453
2025-03-07 04:42:52
Tom Payne
chore: Run shfmt on shell scripts
false
diff --git a/assets/docker/test.sh b/assets/docker/test.sh index bc41266acf3..4156648d66f 100755 --- a/assets/docker/test.sh +++ b/assets/docker/test.sh @@ -2,8 +2,8 @@ set -eufo pipefail -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -REPO_ROOT=$( cd "${SCRIPT_DIR}/../.." &> /dev/null && pwd ) +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +REPO_ROOT=$(cd "${SCRIPT_DIR}/../.." &>/dev/null && pwd) cd "${REPO_ROOT}" if [ "$#" -eq 0 ]; then
chore
Run shfmt on shell scripts
a6b412454b8f3e742583ffbc6cc484ce8bb919dc
2023-02-05 19:42:38
Tom Payne
docs: Refactor links page
false
diff --git a/assets/chezmoi.io/.gitignore b/assets/chezmoi.io/.gitignore index 244f591e75f..a7a7a5db0fc 100644 --- a/assets/chezmoi.io/.gitignore +++ b/assets/chezmoi.io/.gitignore @@ -1,7 +1,9 @@ __pycache__ /docs/index.md /docs/install.md -/docs/links/articles-podcasts-and-videos.md +/docs/links/articles.md +/docs/links/podcasts.md +/docs/links/videos.md /docs/reference/configuration-file/variables.md /docs/reference/release-history.md /site diff --git a/assets/chezmoi.io/docs/hooks.py b/assets/chezmoi.io/docs/hooks.py index 8a352483291..1210081bcc3 100644 --- a/assets/chezmoi.io/docs/hooks.py +++ b/assets/chezmoi.io/docs/hooks.py @@ -15,7 +15,9 @@ templates = [ "index.md", "install.md", - "links/articles-podcasts-and-videos.md", + "links/articles.md", + "links/podcasts.md", + "links/videos.md", "reference/configuration-file/variables.md", "reference/release-history.md", ] diff --git a/assets/chezmoi.io/docs/index.md.tmpl b/assets/chezmoi.io/docs/index.md.tmpl index 5cdafc1b89a..873226a4f8d 100644 --- a/assets/chezmoi.io/docs/index.md.tmpl +++ b/assets/chezmoi.io/docs/index.md.tmpl @@ -41,23 +41,19 @@ description, consult the [reference](/reference/). ## Should I use chezmoi? -See what other people think about chezmoi by [reading articles, listening to -podcasts, and watching videos about -chezmoi](/links/articles-podcasts-and-videos/). Read [how chezmoi compares to -other dotfile managers](/comparison-table/). Explore other people's dotfile -repos that use chezmoi [on -GitHub](https://github.com/topics/chezmoi?o=desc&s=updated), -[GitLab](https://gitlab.com/explore/projects?topic=chezmoi), and -[Codeberg](https://codeberg.org/explore/repos?sort=recentupdate&q=chezmoi&tab=). +See what other people think about chezmoi by reading +[articles](/links/articles), listening to [podcasts](/links/podcasts), and +watching [videos](/links/videos) about chezmoi. Read how [chezmoi compares to +other dotfile managers](/comparison-table/). Explore other people's [dotfile +repos that use chezmoi](/links/dotfile-repos/) that use chezmoi. ## I like chezmoi. How do I say thanks? Please [give chezmoi a star on GitHub](https://github.com/twpayne/chezmoi/stargazers). -[Share chezmoi](/links/articles-podcasts-and-videos/) and, if you're happy to -share your public dotfiles repo, then [tag your repo with -`chezmoi`](https://github.com/topics/chezmoi?o=desc&s=updated). +[Share chezmoi](/links/social-media/) and, if you're happy to share your public +dotfiles repo, then [tag your repo with `chezmoi`](/links/dotfile-repos/). [Contributions are very welcome](/developer/contributing-changes/) and every [bug report, support request, and feature diff --git a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl b/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl deleted file mode 100644 index 27eda7ff169..00000000000 --- a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.tmpl +++ /dev/null @@ -1,29 +0,0 @@ -# Articles, podcasts, and videos - -!!! tip - - Recommended article: [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) - -!!! tip - - Recommended video: [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) - -!!! tip - - Recommended podcast: [Managing Dot Files and an Introduction to Chezmoi](https://www.podfeet.com/blog/2021/07/ccatp-693/) - -| Date | Version | Format | Link | -| ---- | ------- | ------ | ---- | -{{- range mustReverse .articles }} -{{- $format := index . "format" | default "Text" }} -{{- $lang := index . "lang" | default "EN" }} -{{- if ne $lang "EN" }} -{{- $format = printf "%s (%s)" $format $lang }} -{{- end }} -| {{ .date }} | {{ .version }} | {{ $format }} | [{{ .title }}]({{ .url }}) | -{{- end }} - -To add your article to this page please either [open an -issue](https://github.com/twpayne/chezmoi/issues/new/choose) or submit a pull -request that modifies -`assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml`. diff --git a/assets/chezmoi.io/docs/links/articles.md.tmpl b/assets/chezmoi.io/docs/links/articles.md.tmpl new file mode 100644 index 00000000000..efe966d5e36 --- /dev/null +++ b/assets/chezmoi.io/docs/links/articles.md.tmpl @@ -0,0 +1,13 @@ +# Articles + +!!! tip + + Recommended article: [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) + +| Date | Version | Lang | Title | +| ---- | ------- | ---- | ----- | +{{- range mustReverse .articles }} +{{- if not (index . "formats") }} +| {{ .date }} | {{ .version }} | {{ index . "lang" | default "EN" }} | [{{ .title }}]({{ .url }}) | +{{- end }} +{{- end }} diff --git a/assets/chezmoi.io/docs/links/articles.md.yaml b/assets/chezmoi.io/docs/links/articles.md.yaml new file mode 120000 index 00000000000..c2320c8c261 --- /dev/null +++ b/assets/chezmoi.io/docs/links/articles.md.yaml @@ -0,0 +1 @@ +links.yaml \ No newline at end of file diff --git a/assets/chezmoi.io/docs/links/dotfile-repos-using-chezmoi.md b/assets/chezmoi.io/docs/links/dotfile-repos.md similarity index 56% rename from assets/chezmoi.io/docs/links/dotfile-repos-using-chezmoi.md rename to assets/chezmoi.io/docs/links/dotfile-repos.md index 50e1496912e..e4b17ba5ba8 100644 --- a/assets/chezmoi.io/docs/links/dotfile-repos-using-chezmoi.md +++ b/assets/chezmoi.io/docs/links/dotfile-repos.md @@ -1,5 +1,7 @@ -# Dotfile repos using chezmoi +# Dotfile repos * [GitHub](https://github.com/topics/chezmoi?o=desc&s=updated) * [GitLab](https://gitlab.com/explore/projects/topics/chezmoi) + +* [Codeberg](https://codeberg.org/explore/repos?sort=recentupdate&q=chezmoi&tab=) diff --git a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml b/assets/chezmoi.io/docs/links/links.yaml similarity index 90% rename from assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml rename to assets/chezmoi.io/docs/links/links.yaml index 910cc3ce081..b74c603f47d 100644 --- a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml +++ b/assets/chezmoi.io/docs/links/links.yaml @@ -5,12 +5,15 @@ articles: url: https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/ - date: '2019-11-20' version: 1.7.2 - format: Audio/video + formats: + - audio + - video title: 'FLOSS weekly episode 556: chezmoi' url: https://twit.tv/shows/floss-weekly/episodes/556 - date: '2020-03-12' version: 1.7.16 - format: Video + formats: + - video title: Managing Dotfiles with ChezMoi url: https://www.youtube.com/watch?v=HXx6ugA98Qo - date: '2020-04-01' @@ -55,7 +58,8 @@ articles: url: https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container - date: '2020-07-06' version: 1.8.3 - format: Video + formats: + - video title: 'Conf42: chezmoi: Manage your dotfiles across multiple machines, securely' url: https://www.youtube.com/watch?v=JrCMCdvoMAw - date: '2020-08-03' @@ -98,7 +102,8 @@ articles: url: https://axionl.me/p/%E5%BD%92%E6%A1%A3-%E7%94%A8-chezmoi-%E7%AE%A1%E7%90%86%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/ - date: '2021-02-06' version: 1.8.10 - format: Video + formats: + - video title: 'chezmoi: manage your dotfiles across multiple, diverse machines, securely' url: https://fosdem.org/2021/schedule/event/chezmoi/ - date: '2021-02-07' @@ -139,9 +144,14 @@ articles: url: https://marvinsblog.net/post/2021-07-15-chezmoi-intro/ - date: '2021-07-23' version: 2.1.2 - format: Audio/text - title: PBS 121 of X — Managing Dot Files and an Introduction to Chezmoi + formats: + - audio + title: 'CCATP #693 – Bart Busschots on PBS 121 of X — Managing Dot Files and an Introduction to Chezmoi' url: https://www.podfeet.com/blog/2021/07/ccatp-693/ +- date: '2021-07-23' + version: 2.1.2 + title: PBS 121 of X — Managing Dot Files and an Introduction to Chezmoi + url: https://pbs.bartificer.net/pbs121 - date: '2021-08-04' version: 2.1.2 lang: PT @@ -150,17 +160,32 @@ articles: url: https://sempreupdate.com.br/como-instalar-o-chezmoi-um-gerenciador-de-dotfiles-no-ubuntu-linux-mint-fedora-debian/ - date: '2021-08-08' version: 2.1.2 - format: Audio/text + formats: + - audio + title: 'CCATP #695 – Bart Busschots on PBS 122 – Managing Dot Files with Chezmoi' + url: https://www.podfeet.com/blog/2021/08/ccatp-695/ +- date: '2021-08-08' + version: 2.1.2 title: PBS 122 of X — Managing Dot Files with Chezmoi url: https://pbs.bartificer.net/pbs122 - date: '2021-08-22' version: 2.1.2 - format: Audio/text + formats: + - audio + title: 'CCATP #696 – Bart Busschots on PBS 123 of X — Backing up and Syncing Dot Files with Chezmoi' + url: https://www.podfeet.com/blog/2021/08/ccatp-696/ +- date: '2021-08-22' + version: 2.1.2 title: PBS 123 of X — Backing up and Syncing Dot Files with Chezmoi url: https://pbs.bartificer.net/pbs123 - date: '2021-09-04' version: 2.1.2 - format: Audio/text + formats: + - audio + title: 'CCATP #698 – Bart Busschots on PBS 124 of X – Chezmoi Templates' + url: https://www.podfeet.com/blog/2021/09/ccatp-698/ +- date: '2021-09-04' + version: 2.1.2 title: PBS 124 of X — Chezmoi Templates url: https://pbs.bartificer.net/pbs124 - date: '2021-09-04' @@ -173,7 +198,8 @@ articles: url: https://www.jacobbolda.com/chezmoi-dotfile-management - date: '2021-09-06' version: 2.2.0 - format: Video + formats: + - video title: 'chezmoi: Organize your dotfiles across multiple computers' url: https://www.youtube.com/watch?v=L_Y3s0PS_Cg - date: '2021-09-14' @@ -182,7 +208,12 @@ articles: url: https://zacwe.st/2021/09/14/managing-preference-plists-under-chezmoi/ - date: '2021-09-18' version: 2.1.2 - format: Audio/text + formats: + - audio + title: 'CCATP #699 – Bart Busschots on PBS 125 of X – Chezmoi on Multiple Computers' + url: https://www.podfeet.com/blog/2021/09/ccatp-699/ +- date: '2021-09-18' + version: 2.1.2 title: PBS 125 of X — Chezmoi on Multiple Computers url: https://pbs.bartificer.net/pbs125 - date: '2021-10-25' @@ -200,7 +231,8 @@ articles: url: https://scottbanwart.com/blog/2021/11/weekly-journal-47-chezmoi-neovim/ - date: '2021-11-27' version: 2.8.0 - format: Video + formats: + - video lang: TH title: 'Command ไร 2021-11-27 : ย้าย dotfiles ไป chezmoi' url: https://www.youtube.com/watch?v=8ybNfCfnF2Y @@ -214,7 +246,8 @@ articles: url: https://zerokspot.com/weblog/2021/12/04/advanced-chezmoi/ - date: '2021-12-08' version: 2.9.3 - format: Video + formats: + - video title: How Go makes chezmoi possible url: https://www.youtube.com/watch?v=5XiewS8ZbH8&t=1044s - date: '2021-12-13' @@ -269,7 +302,8 @@ articles: url: https://thenewstack.io/local-environment-as-code-is-it-possible-yet/ - date: '2022-03-11' version: 2.14.0 - format: Audio + formats: + - audio title: 'The Real Python Podcast: Episode 101: Tools for Setting Up Python on a New Machine' url: https://realpython.com/podcasts/rpp/101/#t=3368 @@ -283,7 +317,8 @@ articles: url: https://christitus.com/chezmoi/ - date: '2022-04-27' version: 2.15.1 - format: Video + formats: + - video title: Easily moving Linux installs url: https://www.youtube.com/watch?v=x6063EuxfEA - date: '2022-05-16' @@ -292,7 +327,8 @@ articles: url: https://www.spatacoli.com/blog/2022/05/chezmoi-for-dotfiles/ - date: '2022-05-27' version: 2.17.0 - format: Audio + formats: + - audio title: Fédérer une communauté technique autour d'un projet Open Source url: https://www.podcastics.com/podcast/episode/federer-une-communaute-technique-autour-dun-projet-open-source-131694/ - date: '2022-06-02' @@ -312,7 +348,8 @@ articles: - date: '2022-09-13' version: 2.22.1 title: Using chezmoi to automate dotfiles / config files (+ my bashrc) - format: Video + formats: + - video url: https://www.youtube.com/watch?v=id5UKYuX4-A - date: '2022-09-13' version: 2.22.1 diff --git a/assets/chezmoi.io/docs/links/podcasts.md.tmpl b/assets/chezmoi.io/docs/links/podcasts.md.tmpl new file mode 100644 index 00000000000..98613040a6b --- /dev/null +++ b/assets/chezmoi.io/docs/links/podcasts.md.tmpl @@ -0,0 +1,13 @@ +# Podcasts + +!!! tip + + Recommended podcast: [Managing Dot Files and an Introduction to Chezmoi](https://www.podfeet.com/blog/2021/07/ccatp-693/) + +| Date | Version | Lang | Title | +| ---- | ------- | ---- | ----- | +{{- range mustReverse .articles }} +{{- if mustHas "audio" (index . "formats") }} +| {{ .date }} | {{ .version }} | {{ .lang | default "EN" }} | [{{ .title }}]({{ .url }}) | +{{- end }} +{{- end }} diff --git a/assets/chezmoi.io/docs/links/podcasts.md.yaml b/assets/chezmoi.io/docs/links/podcasts.md.yaml new file mode 120000 index 00000000000..c2320c8c261 --- /dev/null +++ b/assets/chezmoi.io/docs/links/podcasts.md.yaml @@ -0,0 +1 @@ +links.yaml \ No newline at end of file diff --git a/assets/chezmoi.io/docs/links/videos.md.tmpl b/assets/chezmoi.io/docs/links/videos.md.tmpl new file mode 100644 index 00000000000..819c5c97822 --- /dev/null +++ b/assets/chezmoi.io/docs/links/videos.md.tmpl @@ -0,0 +1,13 @@ +# Videos + +!!! tip + + Recommended video: [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) + +| Date | Version | Lang | Title | +| ---- | ------- | ---- | ----- | +{{- range mustReverse .articles }} +{{- if mustHas "video" (index . "formats") }} +| {{ .date }} | {{ .version }} | {{ .lang | default "EN" }} | [{{ .title }}]({{ .url }}) | +{{- end }} +{{- end }} diff --git a/assets/chezmoi.io/docs/links/videos.md.yaml b/assets/chezmoi.io/docs/links/videos.md.yaml new file mode 120000 index 00000000000..c2320c8c261 --- /dev/null +++ b/assets/chezmoi.io/docs/links/videos.md.yaml @@ -0,0 +1 @@ +links.yaml \ No newline at end of file diff --git a/assets/chezmoi.io/docs/quick-start.md b/assets/chezmoi.io/docs/quick-start.md index bd30a6fde55..198bea55183 100644 --- a/assets/chezmoi.io/docs/quick-start.md +++ b/assets/chezmoi.io/docs/quick-start.md @@ -225,8 +225,8 @@ For a full list of commands run: $ chezmoi help ``` -chezmoi has much more functionality. Good starting points are reading [articles -about chezmoi](/links/articles-podcasts-and-videos/) adding more dotfiles, and +chezmoi has much more functionality. Good starting points are reading [what +other people say about chezmoi](/links/articles/), adding more dotfiles, and using templates to manage files that vary from machine to machine and retrieve -secrets from your password manager. Read the [user guide](/user-guide/setup/) -to explore. +secrets from your password manager. Read the [user guide](/user-guide/setup/) to +explore and see [how people use chezmoi](/links/dotfile-repos/) for inspiration. diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index d2cef1c10bc..c5ec1f18bfe 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -278,8 +278,10 @@ nav: - Architecture: developer/architecture.md - Building on top of chezmoi: developer/building-on-top-of-chezmoi.md - Links: - - Articles, podcasts, and videos: links/articles-podcasts-and-videos.md - - Dotfile repos using chezmoi: links/dotfile-repos-using-chezmoi.md + - Articles: links/articles.md + - Podcasts: links/podcasts.md + - Videos: links/videos.md + - Dotfile repos: links/dotfile-repos.md - Related software: links/related-software.md - Social media: links/social-media.md - License: license.md
docs
Refactor links page
df7c852b23185831b7304c36eea7cbcc24ca8459
2022-02-23 01:57:15
Tom Payne
chore: Bump gofumpt to v0.3.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d960585d093..38b1ac6dc26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ on: env: AGE_VERSION: 1.0.0 GO_VERSION: 1.17.7 - GOFUMPT_VERSION: 0.2.1 + GOFUMPT_VERSION: 0.3.0 GOLANGCI_LINT_VERSION: 1.44.2 jobs: changes:
chore
Bump gofumpt to v0.3.0
3f108f75f2f31d5937836332713b68dcc1c8b4a7
2023-05-22 14:00:02
Tom Payne
docs: Update docs on atuin.sh
false
diff --git a/assets/chezmoi.io/docs/links/related-software.md b/assets/chezmoi.io/docs/links/related-software.md index 12f65a2b5d0..9236498c71e 100644 --- a/assets/chezmoi.io/docs/links/related-software.md +++ b/assets/chezmoi.io/docs/links/related-software.md @@ -17,6 +17,10 @@ A plugin for VIM to apply the dotfile you are editing on `:w`. ## Other +### [`atuin.sh`](https://atuin.sh/) + +Sync, search and backup shell history . + ### [`github.com/hussainweb/ansible-role-chezmoi`](https://github.com/hussainweb/ansible-role-chezmoi) Installs chezmoi on Ubuntu and Debian servers. diff --git a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/usage.md b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/usage.md index 13f60dff7f6..c134925c1cd 100644 --- a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/usage.md +++ b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/usage.md @@ -81,14 +81,19 @@ You have several options: state, target state, and destination state. Copy the changes you want to keep in to the source state. -## Can I store/share my shell history with chezmoi? +## Can I use chezmoi to manage my shell history across multiple machines? -Not easily. chezmoi's only shared state between machines is your git repo, and -creating a commit every time a command is entered would quickly become -cumbersome. -Instead, consider using a tool like [atuin](https://github.com/ellie/atuin). You -can use chezmoi to install and configure atuin on new machines. +No. Every change in a file managed by chezmoi requires an explicit command to +record it (e.g. `chezmoi add`) or apply it somewhere else (e.g. `chezmoi +update`), and is recorded as a commit in your dotfiles repository. Creating a +commit every time a command is entered would quickly become cumbersome. This +makes chezmoi unsuitable for sharing changes to rapidly-changing files like +shell histories. + +Instead, consider using a dedicated tool for sharing shell history across +multiple machines, like [`atuin`](https://atuin.sh/). You can use chezmoi to +install and configure atuin. ## How do I install pre-requisites for templates?
docs
Update docs on atuin.sh
6f578d82f7eea1e6ef46ca2038d1e8950d4cfe64
2023-04-08 01:44:35
Tom Payne
chore: Update dependencies
false
diff --git a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md index 6e67b5154c8..2d4cc0f2dd4 100644 --- a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md +++ b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md @@ -3,7 +3,7 @@ `gitHubLatestRelease` calls the GitHub API to retrieve the latest release about the given *owner-repo*, returning structured data as defined by the [GitHub Go API -bindings](https://pkg.go.dev/github.com/google/go-github/v50/github#RepositoryRelease). +bindings](https://pkg.go.dev/github.com/google/go-github/v51/github#RepositoryRelease). Calls to `gitHubLatestRelease` are cached so calling `gitHubLatestRelease` with the same *owner-repo* will only result in one call to the GitHub API. diff --git a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md index f0a73e773fa..9fd366a4498 100644 --- a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md +++ b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md @@ -2,7 +2,7 @@ `gitHubLatestTag` calls the GitHub API to retrieve the latest tag for the given *owner-repo*, returning structured data as defined by the [GitHub Go API -bindings](https://pkg.go.dev/github.com/google/go-github/v50/github#RepositoryTag). +bindings](https://pkg.go.dev/github.com/google/go-github/v51/github#RepositoryTag). Calls to `gitHubLatestTag` are cached so calling `gitHubLatestTag` with the same *owner-repo* will only result in one call to the GitHub API. diff --git a/go.mod b/go.mod index 18713a4ec4a..57eae1aabce 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( filippo.io/age v1.1.1 github.com/Masterminds/sprig/v3 v3.2.3 github.com/Shopify/ejson v1.3.3 - github.com/aws/aws-sdk-go-v2 v1.17.7 - github.com/aws/aws-sdk-go-v2/config v1.18.19 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.1 + github.com/aws/aws-sdk-go-v2 v1.17.8 + github.com/aws/aws-sdk-go-v2/config v1.18.20 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.2 github.com/bmatcuk/doublestar/v4 v4.6.0 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.15.0 @@ -17,11 +17,11 @@ require ( github.com/coreos/go-semver v0.3.1 github.com/fsnotify/fsnotify v1.6.0 github.com/go-git/go-git/v5 v5.6.1 - github.com/google/go-github/v50 v50.2.0 + github.com/google/go-github/v51 v51.0.0 github.com/google/renameio/v2 v2.0.0 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/itchyny/gojq v0.12.12 - github.com/klauspost/compress v1.16.3 + github.com/klauspost/compress v1.16.4 github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/combinator v0.3.0 github.com/muesli/termenv v0.15.1 @@ -41,9 +41,9 @@ require ( github.com/zalando/go-keyring v0.2.2 go.etcd.io/bbolt v1.3.7 go.uber.org/multierr v1.11.0 - golang.org/x/crypto v0.7.0 + golang.org/x/crypto v0.8.0 golang.org/x/exp v0.0.0-20230321023759-10a507213a29 - golang.org/x/oauth2 v0.6.0 + golang.org/x/oauth2 v0.7.0 golang.org/x/sync v0.1.0 golang.org/x/sys v0.7.0 golang.org/x/term v0.7.0 @@ -62,15 +62,15 @@ require ( github.com/alecthomas/chroma v0.10.0 // indirect github.com/alessio/shellescape v1.4.1 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.18 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.19 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.12.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.18.8 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect @@ -81,7 +81,7 @@ require ( github.com/containerd/console v1.0.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dlclark/regexp2 v1.8.1 // indirect + github.com/dlclark/regexp2 v1.9.0 // indirect github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.0 // indirect @@ -122,9 +122,9 @@ require ( github.com/yuin/goldmark v1.5.4 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/text v0.8.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 70f143c9076..5bd39ad352d 100644 --- a/go.sum +++ b/go.sum @@ -28,30 +28,30 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go-v2 v1.17.7 h1:CLSjnhJSTSogvqUGhIC6LqFKATMRexcxLZ0i/Nzk9Eg= -github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.18.19 h1:AqFK6zFNtq4i1EYu+eC7lcKHYnZagMn6SW171la0bGw= -github.com/aws/aws-sdk-go-v2/config v1.18.19/go.mod h1:XvTmGMY8d52ougvakOv1RpiTLPz9dlG/OQHsKU/cMmY= -github.com/aws/aws-sdk-go-v2/credentials v1.13.18 h1:EQMdtHwz0ILTW1hoP+EwuWhwCG1hD6l3+RWFQABET4c= -github.com/aws/aws-sdk-go-v2/credentials v1.13.18/go.mod h1:vnwlwjIe+3XJPBYKu1et30ZPABG3VaXJYr8ryohpIyM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1 h1:gt57MN3liKiyGopcqgNzJb2+d9MJaKT/q1OksHNXVE4= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.1/go.mod h1:lfUx8puBRdM5lVVMQlwt2v+ofiG/X6Ms+dy0UkG/kXw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31 h1:sJLYcS+eZn5EeNINGHSCRAwUJMFVqklwkH36Vbyai7M= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31/go.mod h1:QT0BqUvX1Bh2ABdTGnjqEjvjzrCfIniM9Sc8zn9Yndo= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25 h1:1mnRASEKnkqsntcxHaysxwgVoUUp5dkiB+l3llKnqyg= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25/go.mod h1:zBHOPwhBc3FlQjQJE/D3IfPWiWaQmT06Vq9aNukDo0k= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32 h1:p5luUImdIqywn6JpQsW3tq5GNOxKmOnEpybzPx+d1lk= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.32/go.mod h1:XGhIBZDEgfqmFIugclZ6FU7v75nHhBDtzuB4xB/tEi4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25 h1:5LHn8JQ0qvjD9L9JhMtylnkcw7j05GDZqM9Oin6hpr0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25/go.mod h1:/95IA+0lMnzW6XzqYJRpjjsAbKEORVeO0anQqjd2CNU= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.1 h1:+rANS0SbrDUqF3VJeil1HJHhNK8vdUu1VGqnkr4o6kw= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.1/go.mod h1:SUiYnlcBDUvSLD6iUmwSwXni2i6iGa9WHc+eM5061W4= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.6 h1:5V7DWLBd7wTELVz5bPpwzYy/sikk0gsgZfj40X+l5OI= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.6/go.mod h1:Y1VOmit/Fn6Tz1uFAeCO6Q7M2fmfXSCLeL5INVYsLuY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6 h1:B8cauxOH1W1v7rd8RdI/MWnoR4Ze0wIHWrb90qczxj4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.6/go.mod h1:Lh/bc9XUf8CfOY6Jp5aIkQtN+j1mc+nExc+KXj9jx2s= -github.com/aws/aws-sdk-go-v2/service/sts v1.18.7 h1:bWNgNdRko2x6gqa0blfATqAZKZokPIeM1vfmQt2pnvM= -github.com/aws/aws-sdk-go-v2/service/sts v1.18.7/go.mod h1:JuTnSoeePXmMVe9G8NcjjwgOKEfZ4cOjMuT2IBT/2eI= +github.com/aws/aws-sdk-go-v2 v1.17.8 h1:GMupCNNI7FARX27L7GjCJM8NgivWbRgpjNI/hOQjFS8= +github.com/aws/aws-sdk-go-v2 v1.17.8/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2/config v1.18.20 h1:yYy+onqmLmDVZtx0mkqbx8aJPl+58V6ivLbLDZ2Qztc= +github.com/aws/aws-sdk-go-v2/config v1.18.20/go.mod h1:RWjF39RiDevmHw/+VaD8F0A36OPIPTHQQyRx0eZohnw= +github.com/aws/aws-sdk-go-v2/credentials v1.13.19 h1:FWHJy9uggyQCSEhovtl/6W6rW9P6DSr62GUeY/TS6Eo= +github.com/aws/aws-sdk-go-v2/credentials v1.13.19/go.mod h1:2m4uvLvl5hvQezVkLeBBUGMEDm5GcUNc3016W6d3NGg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2 h1:jOzQAesnBFDmz93feqKnsTHsXrlwWORNZMFHMV+WLFU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2/go.mod h1:cDh1p6XkSGSwSRIArWRc6+UqAQ7x4alQ0QfpVR6f+co= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32 h1:dpbVNUjczQ8Ae3QKHbpHBpfvaVkRdesxpTOe9pTouhU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32/go.mod h1:RudqOgadTWdcS3t/erPQo24pcVEoYyqj/kKW5Vya21I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26 h1:QH2kOS3Ht7x+u0gHCh06CXL/h6G8LQJFpZfFBYBNboo= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26/go.mod h1:vq86l7956VgFr0/FWQ2BWnK07QC3WYsepKzy33qqY5U= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33 h1:HbH1VjUgrCdLJ+4lnnuLI4iVNRvBbBELGaJ5f69ClA8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33/go.mod h1:zG2FcwjQarWaqXSCGpgcr3RSjZ6dHGguZSppUL0XR7Q= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26 h1:uUt4XctZLhl9wBE1L8lobU3bVN8SNUP7T+olb0bWBO4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26/go.mod h1:Bd4C/4PkVGubtNe5iMXu5BNnaBi/9t/UsFspPt4ram8= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.2 h1:mRA8bnA0zdTvsGXmoZ6EOmTTmORjEV1uareB4GfzfK0= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.2/go.mod h1:QNYziZIPDbKmKRoTHi9wkgqVidknyiGHfig1UNOojqk= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.7 h1:rrYYhsvcvg6CDDoo4GHKtAWBFutS86CpmGvqHJHYL9w= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.7/go.mod h1:GNIveDnP+aE3jujyUSH5aZ/rktsTM5EvtKnCqBZawdw= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.7 h1:Vjpjt3svuJ/u+eKRfycZwqLsLoxyuvvZyHMJSk+3k58= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.7/go.mod h1:44qFP1g7pfd+U+sQHLPalAPKnyfTZjJsYR4xIwsJy5o= +github.com/aws/aws-sdk-go-v2/service/sts v1.18.8 h1:SQ8pPoXfzuz4DImO4KAi9xhO4ANG0Ckb5clZ5GoRAPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.18.8/go.mod h1:yyW88BEPXA2fGFyI2KCcZC3dNpiT0CZAHaF+i656/tQ= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= @@ -100,8 +100,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.8.1 h1:6Lcdwya6GjPUNsBct8Lg/yRPwMhABj269AAzdGSiR+0= -github.com/dlclark/regexp2 v1.8.1/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.9.0 h1:pTK/l/3qYIKaRXuHnEnIf7Y5NxfRPfpb7dis6/gdlVI= +github.com/dlclark/regexp2 v1.9.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad h1:Qk76DOWdOp+GlyDKBAG3Klr9cn7N+LcYc82AZ2S7+cA= github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad/go.mod h1:mPKfmRa823oBIgl2r20LeMSpTAteW5j7FLkc0vjmzyQ= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -135,8 +135,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk= -github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q= +github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= +github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= @@ -174,8 +174,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= +github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -335,8 +335,9 @@ golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -355,10 +356,11 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= @@ -406,15 +408,16 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/cmds/execute-template/main.go b/internal/cmds/execute-template/main.go index 32556b0c4cc..ec7dbac0f97 100644 --- a/internal/cmds/execute-template/main.go +++ b/internal/cmds/execute-template/main.go @@ -16,7 +16,7 @@ import ( "text/template" "github.com/Masterminds/sprig/v3" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "github.com/google/renameio/v2/maybe" "gopkg.in/yaml.v3" diff --git a/pkg/chezmoi/github.go b/pkg/chezmoi/github.go index fd3d003f914..d028deb956f 100644 --- a/pkg/chezmoi/github.go +++ b/pkg/chezmoi/github.go @@ -5,7 +5,7 @@ import ( "net/http" "os" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "golang.org/x/oauth2" ) diff --git a/pkg/cmd/doctorcmd.go b/pkg/cmd/doctorcmd.go index 64be789b147..82c081d8fc2 100644 --- a/pkg/cmd/doctorcmd.go +++ b/pkg/cmd/doctorcmd.go @@ -19,7 +19,7 @@ import ( "time" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "github.com/spf13/cobra" "github.com/twpayne/go-xdg/v6" diff --git a/pkg/cmd/githubtemplatefuncs.go b/pkg/cmd/githubtemplatefuncs.go index 08e0f7dace2..d6c336de60a 100644 --- a/pkg/cmd/githubtemplatefuncs.go +++ b/pkg/cmd/githubtemplatefuncs.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "github.com/twpayne/chezmoi/v2/pkg/chezmoi" ) diff --git a/pkg/cmd/upgradecmd.go b/pkg/cmd/upgradecmd.go index 7d3d1e54daf..6215f01cb10 100644 --- a/pkg/cmd/upgradecmd.go +++ b/pkg/cmd/upgradecmd.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/coreos/go-semver/semver" - "github.com/google/go-github/v50/github" + "github.com/google/go-github/v51/github" "github.com/spf13/cobra" vfs "github.com/twpayne/go-vfs/v4"
chore
Update dependencies
96e38535d38eec10ab504e975fb7cb867542108e
2022-10-12 16:25:06
Tom Payne
chore: Fail if multiple config files are found
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 65d98a414b4..ba1c2b81c67 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -179,6 +179,7 @@ type Config struct { fileSystem vfs.FS bds *xdg.BaseDirectorySpecification configFileAbsPath chezmoi.AbsPath + configFileAbsPathErr error baseSystem chezmoi.System sourceSystem chezmoi.System destSystem chezmoi.System @@ -390,10 +391,7 @@ func newConfig(options ...configOption) (*Config, error) { if err != nil { return nil, err } - c.configFileAbsPath, err = c.defaultConfigFile(c.fileSystem, c.bds) - if err != nil { - return nil, err - } + c.configFileAbsPath, c.configFileAbsPathErr = c.defaultConfigFile(c.fileSystem, c.bds) c.SourceDirAbsPath, err = c.defaultSourceDir(c.fileSystem, c.bds) if err != nil { return nil, err @@ -721,13 +719,29 @@ CONFIG_DIR: dirEntryNames[dirEntry.Name()] = struct{}{} } + var names []string for _, extension := range chezmoi.FormatExtensions { name := "chezmoi." + extension if _, ok := dirEntryNames[name]; ok { - return configDirAbsPath.JoinString("chezmoi", name), nil + names = append(names, name) + } + } + + switch len(names) { + case 0: + // Do nothing. + case 1: + return configDirAbsPath.JoinString("chezmoi", names[0]), nil + default: + configFileAbsPathStrs := make([]string, 0, len(names)) + for _, name := range names { + configFileAbsPathStr := configDirAbsPath.JoinString("chezmoi", name) + configFileAbsPathStrs = append(configFileAbsPathStrs, configFileAbsPathStr.String()) } + return chezmoi.EmptyAbsPath, fmt.Errorf("multiple config files: %s", englishList(configFileAbsPathStrs)) } } + // Fallback to XDG Base Directory Specification default. configHomeAbsPath, err := chezmoi.NewAbsPathFromExtPath(bds.ConfigHome, c.homeDirAbsPath) if err != nil { @@ -1681,11 +1695,17 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error }) // Read the config file. - if err := c.readConfig(); err != nil { - if !boolAnnotation(cmd, doesNotRequireValidConfig) { + if boolAnnotation(cmd, doesNotRequireValidConfig) { + if c.configFileAbsPathErr == nil { + _ = c.readConfig() + } + } else { + if c.configFileAbsPathErr != nil { + return c.configFileAbsPathErr + } + if err := c.readConfig(); err != nil { return fmt.Errorf("invalid config: %s: %w", c.configFileAbsPath, err) } - c.errorf("warning: %s: %v\n", c.configFileAbsPath, err) } // Restore flags that were set on the command line. diff --git a/pkg/cmd/testdata/scripts/config.txtar b/pkg/cmd/testdata/scripts/config.txtar index 3f216fc8457..93e006219de 100644 --- a/pkg/cmd/testdata/scripts/config.txtar +++ b/pkg/cmd/testdata/scripts/config.txtar @@ -17,7 +17,7 @@ exec chezmoi data --format=yaml stdout 'sourceDir: .*/config/source' # test that the config file can be set -exec chezmoi data --config=$CHEZMOICONFIGDIR/chezmoi.yaml --format=yaml +exec chezmoi data --config=$HOME/.chezmoi.yaml --format=yaml stdout 'sourceDir: .*/config2/source' # test that the cache directory can be set @@ -27,13 +27,13 @@ stdout 'cacheDir: .*/flag/cache' [windows] stop 'remaining tests require /dev/stdin' # test that chezmoi can read the config from stdin -stdin home2/user/.config/chezmoi/chezmoi.yaml +stdin home2/user/.chezmoi.yaml exec chezmoi data --config=/dev/stdin --config-format=yaml --format=yaml stdout 'sourceDir: .*/config2/source' +-- home2/user/.chezmoi.yaml -- +color: auto +sourceDir: /config2/source -- home2/user/.config/chezmoi/chezmoi.toml -- color = "auto" sourceDir = "/config/source" --- home2/user/.config/chezmoi/chezmoi.yaml -- -color: auto -sourceDir: /config2/source diff --git a/pkg/cmd/testdata/scripts/doctor_unix.txtar b/pkg/cmd/testdata/scripts/doctor_unix.txtar index 217b9967d79..133f7952666 100644 --- a/pkg/cmd/testdata/scripts/doctor_unix.txtar +++ b/pkg/cmd/testdata/scripts/doctor_unix.txtar @@ -27,7 +27,7 @@ stdout '^\w+\s+latest-version\s+' stdout '^ok\s+os-arch\s+' ! stdout '^\S+\s+systeminfo\s+' stdout '^ok\s+uname\s+' -stdout '^warning\s+config-file\s+.*multiple config files' +stdout '^ok\s+config-file\s+' stdout '^ok\s+source-dir\s+' stdout '^warning\s+suspicious-entries\s+' stdout '^ok\s+dest-dir\s+' @@ -68,6 +68,13 @@ chhome home3/user exec chezmoi doctor stdout '^warning\s+suspicious-entries\s+' +chhome home4/user + +# test that chezmoi doctor does not print a warning about multiple config files +! exec chezmoi doctor +stdout '^warning\s+config-file\s+.*multiple config files' +! stderr . + -- bin/age -- #!/bin/sh @@ -159,9 +166,10 @@ echo "Vault v1.5.5 ('f5d1ddb3750e7c28e25036e1ef26a4c02379fc01+CHANGES')" command = "pinentry" [secret] command = "secret" --- home/user/.config/chezmoi/chezmoi.yaml -- -- home/user/.local/share/chezmoi/.chezmoidata.json -- -- home/user/.local/share/chezmoi/.chezmoiexternal.toml -- -- home/user/.local/share/chezmoi/.chezmoiscripts/.keep -- -- home/user/.local/share/chezmoi/dot_config/chezmoi/chezmoi.toml.tmpl -- -- home3/user/.local/share/chezmoi/.chezmoisuspicious -- +-- home4/user/.config/chezmoi/chezmoi.json -- +-- home4/user/.config/chezmoi/chezmoi.yaml -- diff --git a/pkg/cmd/testdata/scripts/errors.txtar b/pkg/cmd/testdata/scripts/errors.txtar index bfd8cccdb56..d1d4d76180e 100644 --- a/pkg/cmd/testdata/scripts/errors.txtar +++ b/pkg/cmd/testdata/scripts/errors.txtar @@ -40,6 +40,12 @@ chhome home7/user ! exec chezmoi init stderr 'multiple config file templates' +chhome home8/user + +# test that chezmoi verify returns an error if there are multiple config files +! exec chezmoi verify +stderr 'multiple config files' + # FIXME add more tests -- home2/user/.config/chezmoi/chezmoi.json -- @@ -58,3 +64,6 @@ home # contents of install_packages -- home7/user/.local/share/chezmoi/.chezmoi.json.tmpl -- -- home7/user/.local/share/chezmoi/.chezmoi.toml.tmpl -- +-- home8/user/.config/chezmoi/chezmoi.json -- +-- home8/user/.config/chezmoi/chezmoi.toml -- +-- home8/user/.local/share/chezmoi/.keep --
chore
Fail if multiple config files are found
2ab20f454bc50f0043c0ebca4d8dcd11820b3177
2023-03-01 13:06:45
dependabot[bot]
chore(deps): bump cpina/github-action-push-to-another-repository
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11b9870ddf5..10af94ec428 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -452,7 +452,7 @@ jobs: cp assets/scripts/install.ps1 assets/get.chezmoi.io/ps1 cp LICENSE assets/get.chezmoi.io/LICENSE - name: push-get.chezmoi.io - uses: cpina/github-action-push-to-another-repository@9e487f29582587eeb4837c0552c886bb0644b6b9 + uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 env: SSH_DEPLOY_KEY: ${{ secrets.GET_CHEZMOI_IO_SSH_DEPLOY_KEY }} with:
chore
bump cpina/github-action-push-to-another-repository
cbed719948c892709bedacb9c9bfa514e7f88f6a
2022-06-15 01:24:13
Tom Payne
feat: Include git working tree state in doctor output
false
diff --git a/pkg/cmd/doctorcmd.go b/pkg/cmd/doctorcmd.go index 46b09ff5167..c0c37215d1a 100644 --- a/pkg/cmd/doctorcmd.go +++ b/pkg/cmd/doctorcmd.go @@ -27,6 +27,7 @@ import ( "github.com/twpayne/chezmoi/v2/pkg/chezmoi" "github.com/twpayne/chezmoi/v2/pkg/chezmoilog" + "github.com/twpayne/chezmoi/v2/pkg/git" ) // A checkResult is the result of a check. @@ -41,6 +42,16 @@ const ( checkResultError checkResult = 3 // The check completed and found a definite problem. ) +// A gitStatus is the status of a git working copy. +type gitStatus string + +const ( + gitStatusNotAWorkingCopy gitStatus = "" + gitStatusClean gitStatus = "clean" + gitStatusDirty gitStatus = "dirty" + gitStatusError gitStatus = "error" +) + // A check is an individual check. type check interface { Name() string // Name returns the check's name. @@ -496,10 +507,45 @@ func (c *dirCheck) Name() string { } func (c *dirCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { - if _, err := system.ReadDir(c.dirname); err != nil { + dirEntries, err := system.ReadDir(c.dirname) + if err != nil { return checkResultError, err.Error() } - return checkResultOK, fmt.Sprintf("%s is a directory", c.dirname) + + gitStatus := gitStatusNotAWorkingCopy + for _, dirEntry := range dirEntries { + if dirEntry.Name() != ".git" { + continue + } + //nolint:gosec + cmd := exec.Command("git", "-C", c.dirname.String(), "status", "--porcelain=v2") + output, err := cmd.Output() + if err != nil { + gitStatus = gitStatusError + break + } + switch status, err := git.ParseStatusPorcelainV2(output); { + case err != nil: + gitStatus = gitStatusError + case status.Empty(): + gitStatus = gitStatusClean + default: + gitStatus = gitStatusDirty + } + break + } + switch gitStatus { + case gitStatusNotAWorkingCopy: + return checkResultOK, fmt.Sprintf("%s is a directory", c.dirname) + case gitStatusClean: + return checkResultOK, fmt.Sprintf("%s is a git working tree (clean)", c.dirname) + case gitStatusDirty: + return checkResultWarning, fmt.Sprintf("%s is a git working tree (dirty)", c.dirname) + case gitStatusError: + return checkResultError, fmt.Sprintf("%s is a git working tree (error)", c.dirname) + default: + panic(fmt.Sprintf("%s: unknown git status", gitStatus)) + } } func (executableCheck) Name() string {
feat
Include git working tree state in doctor output
470589155d6b72065a1138a88456ef1e4925f7ce
2025-02-28 06:12:27
Tom Payne
docs: Add example of multiple age recipients
false
diff --git a/assets/chezmoi.io/docs/user-guide/encryption/age.md b/assets/chezmoi.io/docs/user-guide/encryption/age.md index 79b5a46decf..8d4209ec168 100644 --- a/assets/chezmoi.io/docs/user-guide/encryption/age.md +++ b/assets/chezmoi.io/docs/user-guide/encryption/age.md @@ -19,8 +19,14 @@ encryption = "age" recipient = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p" ``` -chezmoi supports multiple recipients and recipient files, and multiple -identities. +chezmoi supports multiple identities and multiple recipients: + +```toml title="~/.config/chezmoi/chezmoi.toml" +encryption = "age" +[age] + identities = ["/home/user/key1.txt", "/home/user/key2.txt"] + recipients = ["recipient1", "recipient2"] +``` !!! note
docs
Add example of multiple age recipients
6228e09c041c745b97db980d3a30045dfbd752c9
2022-02-15 02:12:53
Tom Payne
fix: Fix bug where chezmoi init --apply did not configure encryption
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index a0de367b033..e046dd3fd0f 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -709,6 +709,9 @@ func (c *Config) createAndReloadConfigFile() error { if err := viper.Unmarshal(c, viperDecodeConfigOptions...); err != nil { return err } + if err := c.setEncryption(); err != nil { + return err + } } return nil @@ -1641,35 +1644,8 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error }) } - // Set up encryption. - switch c.Encryption { - case "age": - // Only use builtin age encryption if age encryption is explicitly - // specified. Otherwise, chezmoi would fall back to using age encryption - // (rather than no encryption) if age is not in $PATH, which leads to - // error messages from the builtin age instead of error messages about - // encryption not being configured. - c.Age.UseBuiltin = c.UseBuiltinAge.Value(c.useBuiltinAgeAutoFunc) - c.encryption = &c.Age - case "gpg": - c.encryption = &c.GPG - case "": - // Detect encryption if any non-default configuration is set, preferring - // gpg for backwards compatibility. - switch { - case !reflect.DeepEqual(c.GPG, defaultGPGEncryptionConfig): - c.encryption = &c.GPG - case !reflect.DeepEqual(c.Age, defaultAgeEncryptionConfig): - c.encryption = &c.Age - default: - c.encryption = chezmoi.NoEncryption{} - } - default: - return fmt.Errorf("%s: unknown encryption", c.Encryption) - } - if c.debug { - encryptionLogger := c.logger.With().Str(logComponentKey, logComponentValueEncryption).Logger() - c.encryption = chezmoi.NewDebugEncryption(c.encryption, &encryptionLogger) + if err := c.setEncryption(); err != nil { + return err } // Create the config directory if needed. @@ -1839,6 +1815,42 @@ func (c *Config) runEditor(args []string) error { return err } +// setEncryption configures c's encryption. +func (c *Config) setEncryption() error { + switch c.Encryption { + case "age": + // Only use builtin age encryption if age encryption is explicitly + // specified. Otherwise, chezmoi would fall back to using age encryption + // (rather than no encryption) if age is not in $PATH, which leads to + // error messages from the builtin age instead of error messages about + // encryption not being configured. + c.Age.UseBuiltin = c.UseBuiltinAge.Value(c.useBuiltinAgeAutoFunc) + c.encryption = &c.Age + case "gpg": + c.encryption = &c.GPG + case "": + // Detect encryption if any non-default configuration is set, preferring + // gpg for backwards compatibility. + switch { + case !reflect.DeepEqual(c.GPG, defaultGPGEncryptionConfig): + c.encryption = &c.GPG + case !reflect.DeepEqual(c.Age, defaultAgeEncryptionConfig): + c.encryption = &c.Age + default: + c.encryption = chezmoi.NoEncryption{} + } + default: + return fmt.Errorf("%s: unknown encryption", c.Encryption) + } + + if c.debug { + encryptionLogger := c.logger.With().Str(logComponentKey, logComponentValueEncryption).Logger() + c.encryption = chezmoi.NewDebugEncryption(c.encryption, &encryptionLogger) + } + + return nil +} + // sourceAbsPaths returns the source absolute paths for each target path in // args. func (c *Config) sourceAbsPaths(sourceState *chezmoi.SourceState, args []string) ([]chezmoi.AbsPath, error) { diff --git a/pkg/cmd/testdata/scripts/issue1794.txt b/pkg/cmd/testdata/scripts/issue1794.txt new file mode 100644 index 00000000000..3d14d2f5b2b --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue1794.txt @@ -0,0 +1,22 @@ +[!exec:age] skip 'age not found in $PATH' + +mkageconfig +mkgitconfig + +# create a dotfile repo with a config file template and an encrypted file +chezmoi init +cp $CHEZMOICONFIGDIR/chezmoi.toml $CHEZMOISOURCEDIR/.chezmoi.toml.tmpl +chezmoi add --encrypt $HOME/.file +chezmoi git add . +chezmoi git commit -- --message 'Initial commit' + +chhome home2/user + +# test that chezmoi init --apply uses the configured encryption from the template +chezmoi init --apply file://$WORK/home/user/.local/share/chezmoi +cmp $HOME/.file golden/.file + +-- golden/.file -- +# contents of .file +-- home/user/.file -- +# contents of .file
fix
Fix bug where chezmoi init --apply did not configure encryption
f1b404d05b20993fc550653be70f1ea8a686fce3
2022-09-14 02:53:01
Tom Payne
docs: Add link to video
false
diff --git a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml b/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml index 8ec76f04597..411aaf74587 100644 --- a/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml +++ b/assets/chezmoi.io/docs/links/articles-podcasts-and-videos.md.yaml @@ -301,3 +301,8 @@ articles: title: 'chezmoi で Linux と macOS 両方で使える dotfiles を作る' lang: 'JP' url: https://www.docswell.com/s/iosiftakakura/K2EXM5-2022-06-11-chezmoi +- date: '2022-09-13' + version: '2.22.1' + title: 'Using chezmoi to automate dotfiles / config files (+ my bashrc)' + format: Video + url: https://www.youtube.com/watch?v=id5UKYuX4-A
docs
Add link to video
928f1df2e103a93134e9361fb3800a62110ad584
2023-01-28 21:10:53
Tom Payne
feat: Add zstd compression support
false
diff --git a/assets/chezmoi.io/docs/developer/developing-locally.md b/assets/chezmoi.io/docs/developer/developing-locally.md index bae344a9b38..f36c35b79c5 100644 --- a/assets/chezmoi.io/docs/developer/developing-locally.md +++ b/assets/chezmoi.io/docs/developer/developing-locally.md @@ -36,7 +36,7 @@ $ go test ./... chezmoi's tests include integration tests with other software. If the other software is not found in `$PATH` the tests will be skipped. Running the full set of tests requires `age`, `base64`, `bash`, `gpg`, `perl`, `python3`, -`ruby`, `sed`, `sha256sum`, `unzip`, `xz`, and `zip`. +`ruby`, `sed`, `sha256sum`, `unzip`, `xz`, `zip`, and `zstd`. Run chezmoi: diff --git a/assets/chezmoi.io/docs/reference/commands/import.md b/assets/chezmoi.io/docs/reference/commands/import.md index b1bc1838d50..4c4dd4ab640 100644 --- a/assets/chezmoi.io/docs/reference/commands/import.md +++ b/assets/chezmoi.io/docs/reference/commands/import.md @@ -6,7 +6,7 @@ exactly match the contents of a downloaded archive. You will generally always want to set the `--destination`, `--exact`, and `--remove-destination` flags. The supported archive formats are `tar`, `tar.gz`, `tgz`, `tar.bz2`, `tbz2`, -`xz`, and `zip`. +`xz`, `.tar.zst`, and `zip`. ## `--destination` *directory* diff --git a/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md index 7996dcfb36f..de6d5767577 100644 --- a/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md +++ b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md @@ -62,8 +62,8 @@ the directory and all subdirectories will be treated as exact directories, i.e. integer field `stripComponents` will remove leading path components from the members of archive. The optional string field `format` sets the archive format. The supported archive formats are `tar`, `tar.gz`, `tgz`, `tar.bz2`, `tbz2`, -`xz`, and `zip`. If `format` is not specified then chezmoi will guess the format -using firstly the path of the URL and secondly its contents. +`xz`, `.tar.zst`, and `zip`. If `format` is not specified then chezmoi will +guess the format using firstly the path of the URL and secondly its contents. The optional `include` and `exclude` fields are lists of patterns specify which archive members to include or exclude respectively. Patterns match paths in the diff --git a/go.mod b/go.mod index 4e4749bf11c..c07feb4b4db 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( github.com/google/go-github/v49 v49.1.0 github.com/google/renameio/v2 v2.0.0 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 + github.com/klauspost/compress v1.15.15 github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/combinator v0.3.0 github.com/muesli/termenv v0.13.0 diff --git a/go.sum b/go.sum index f05674954e6..635b1543d1f 100644 --- a/go.sum +++ b/go.sum @@ -160,6 +160,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/pkg/chezmoi/archive.go b/pkg/chezmoi/archive.go index b149cba2bcd..df79e88e39c 100644 --- a/pkg/chezmoi/archive.go +++ b/pkg/chezmoi/archive.go @@ -14,6 +14,7 @@ import ( "strings" "time" + "github.com/klauspost/compress/zstd" "github.com/ulikunitz/xz" ) @@ -28,6 +29,7 @@ const ( ArchiveFormatTarBz2 ArchiveFormat = "tar.bz2" ArchiveFormatTarGz ArchiveFormat = "tar.gz" ArchiveFormatTarXz ArchiveFormat = "tar.xz" + ArchiveFormatTarZst ArchiveFormat = "tar.zst" ArchiveFormatTbz2 ArchiveFormat = "tbz2" ArchiveFormatTgz ArchiveFormat = "tgz" ArchiveFormatTxz ArchiveFormat = "txz" @@ -73,6 +75,8 @@ func GuessArchiveFormat(path string, data []byte) ArchiveFormat { return ArchiveFormatTarGz case strings.HasSuffix(pathLower, ".tar.xz") || strings.HasSuffix(pathLower, ".txz"): return ArchiveFormatTarXz + case strings.HasSuffix(pathLower, ".tar.zst"): + return ArchiveFormatTarZst case strings.HasSuffix(pathLower, ".zip"): return ArchiveFormatZip } @@ -84,6 +88,8 @@ func GuessArchiveFormat(path string, data []byte) ArchiveFormat { return ArchiveFormatZip case len(data) >= xz.HeaderLen && xz.ValidHeader(data): return ArchiveFormatTarXz + case (&zstd.Header{}).Decode(data) == nil: + return ArchiveFormatTarZst case isTarArchive(bytes.NewReader(data)): return ArchiveFormatTar case isTarArchive(bzip2.NewReader(bytes.NewReader(data))): @@ -120,6 +126,13 @@ func WalkArchive(data []byte, format ArchiveFormat, f WalkArchiveFunc) error { if err != nil { return err } + case ArchiveFormatTarZst: + // Decompress with zstd. + var err error + r, err = zstd.NewReader(r) + if err != nil { + return err + } default: return UnknownArchiveFormatError(format) } diff --git a/pkg/cmd/testdata/scripts/importtarzst.txtar b/pkg/cmd/testdata/scripts/importtarzst.txtar new file mode 100644 index 00000000000..9cfb6b7bb08 --- /dev/null +++ b/pkg/cmd/testdata/scripts/importtarzst.txtar @@ -0,0 +1,13 @@ +[(openbsd||windows)] skip 'tar does not support zstd compression' +[!exec:zstd] skip 'zstd not found in $PATH' +exec tar -c -f archive.tar.zst --use-compress-program zstd archive + +# test that chezmoi import imports a tar.zst archive +exec chezmoi import --destination=$HOME${/}.dir --strip-components=1 archive.tar.zst +cmp $CHEZMOISOURCEDIR/dot_dir/dir/file golden/dot_dir/dir/file + +-- archive/dir/file -- +# contents of dir/file +-- golden/dot_dir/dir/file -- +# contents of dir/file +-- home/user/.local/share/chezmoi/dot_dir/.keep --
feat
Add zstd compression support
312c1976796d7ecf8519299a1e83faa937650d73
2023-03-15 05:20:44
dependabot[bot]
chore(deps): bump google.golang.org/protobuf from 1.29.0 to 1.29.1
false
diff --git a/go.mod b/go.mod index e50d55069f9..116e74ac3ff 100644 --- a/go.mod +++ b/go.mod @@ -123,7 +123,7 @@ require ( golang.org/x/text v0.8.0 // indirect golang.org/x/tools v0.7.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.29.0 // indirect + google.golang.org/protobuf v1.29.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 0d3df386994..562762bc02c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ -cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ= filippo.io/age v1.1.1 h1:pIpO7l151hCnQ4BdyBujnGP2YlUo0uj6sAVNHGBvXHg= filippo.io/age v1.1.1/go.mod h1:l03SrzDUrBkdBx8+IILdnn2KZysqQdbEBUQ4p3sqEQE= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= @@ -54,7 +52,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.18.6/go.mod h1:48WJ9l3dwP0GSHWGc5sFG github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= -github.com/aymanbagabas/go-osc52 v1.2.1 h1:q2sWUyDcozPLcLabEMd+a+7Ea2DitxZVN9hTxab9L4E= github.com/aymanbagabas/go-osc52 v1.2.1/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= @@ -67,7 +64,6 @@ github.com/bradenhilton/cityhash v1.0.0/go.mod h1:Wmb8yW1egA9ulrsRX4mxfYx5zq4nBW github.com/bradenhilton/mozillainstallhash v1.0.0 h1:QL9byVGb4FrVOI7MubnME3uPNj5R78tqYQPlxuBmXMw= github.com/bradenhilton/mozillainstallhash v1.0.0/go.mod h1:yVD0OX1izZHYl1lBm2UDojyE/k0xIqKJK78k+tdWV+k= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bwesterb/go-ristretto v1.2.2 h1:S2C0mmSjCLS3H9+zfXoIoKzl+cOncvBvt6pE+zTm5Ms= github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= @@ -87,12 +83,9 @@ github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARu github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -158,11 +151,8 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= @@ -171,12 +161,10 @@ github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= @@ -208,7 +196,6 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mmcloughlin/avo v0.5.0 h1:nAco9/aI9Lg2kiuROBY6BhCI/z0t5jEvJfjWbL8qXLU= github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/ansi v0.0.0-20230307104941-78d3738a59f2 h1:95KWtCWqE5TaDGV9kDxSSvuXGGHIZ0FQsr9jHLllfzM= @@ -225,7 +212,6 @@ github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4Y github.com/muesli/termenv v0.14.0/go.mod h1:kG/pF1E7fh949Xhe156crRUrHNyK221IuGO7Ez60Uc8= github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -247,20 +233,16 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= @@ -309,11 +291,8 @@ github.com/zalando/go-keyring v0.2.2 h1:f0xmpYiSrHtSNAVgwip93Cg8tuF45HJM6rHq/A5R github.com/zalando/go-keyring v0.2.2/go.mod h1:sI3evg9Wvpw3+n4SqplGSJUMwtDeROfD4nsFz4z9PG0= go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/gofail v0.1.0 h1:XItAMIhOojXFQMgrxjnd2EIIHun/d5qL0Pf7FzVTkFg= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/arch v0.1.0 h1:oMxhUYsO9VsR1dcoVUjJjIGhx1LXol3989T/yZ59Xsw= golang.org/x/arch v0.1.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -395,14 +374,13 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= -google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -412,12 +390,10 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -426,8 +402,6 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= -mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE= mvdan.cc/sh/v3 v3.6.0 h1:gtva4EXJ0dFNvl5bHjcUEvws+KRcDslT8VKheTYkbGU= mvdan.cc/sh/v3 v3.6.0/go.mod h1:U4mhtBLZ32iWhif5/lD+ygy1zrgaQhUu+XFy7C8+TTA= -rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
chore
bump google.golang.org/protobuf from 1.29.0 to 1.29.1
e925b0f7df71ff45edeea03df94a21ff0ee63d09
2024-02-25 16:11:54
Tom Payne
fix: Fix --keep-going flag for unmanaged command
false
diff --git a/internal/cmd/unmanagedcmd.go b/internal/cmd/unmanagedcmd.go index 00257d1c362..1a74866e226 100644 --- a/internal/cmd/unmanagedcmd.go +++ b/internal/cmd/unmanagedcmd.go @@ -54,6 +54,10 @@ func (c *Config) runUnmanagedCmd(cmd *cobra.Command, args []string, sourceState unmanagedRelPaths := make(map[chezmoi.RelPath]struct{}) walkFunc := func(destAbsPath chezmoi.AbsPath, fileInfo fs.FileInfo, err error) error { if err != nil { + if c.keepGoing { + c.errorf("%s: %v", destAbsPath, err) + return nil + } return err } if destAbsPath == c.DestDirAbsPath {
fix
Fix --keep-going flag for unmanaged command
e1b89f5de53f226e39ea435f5f064ec06ed109e6
2021-10-16 02:12:11
Felipe Santos
docs: fix config file example
false
diff --git a/docs/HOWTO.md b/docs/HOWTO.md index b82470bb30f..e15cdfb3fc6 100644 --- a/docs/HOWTO.md +++ b/docs/HOWTO.md @@ -779,6 +779,7 @@ you will be prompted again. However, you can avoid this with the following example template logic: ``` +{{- $email := "" -}} {{- if (hasKey . "email") -}} {{- $email = .email -}} {{- else -}}
docs
fix config file example
46c6766dd25c135f9c8c269a0e45d250dc4470b7
2022-02-03 02:19:47
Tom Payne
fix: Fix race condition with multiple .chezmoiignore files
false
diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 9dc1d64ef1e..8bbb59e857d 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -92,7 +92,6 @@ type SourceState struct { readTemplateData bool userTemplateData map[string]interface{} priorityTemplateData map[string]interface{} - templateData map[string]interface{} templateFuncs template.FuncMap templateOptions []string templates map[string]*template.Template @@ -703,7 +702,6 @@ func (s *SourceState) ExecuteTemplateData(name string, data []byte) ([]byte, err templateData := s.TemplateData() if chezmoiTemplateData, ok := templateData["chezmoi"].(map[string]interface{}); ok { chezmoiTemplateData["sourceFile"] = name - defer delete(chezmoiTemplateData, "sourceFile") } builder := strings.Builder{} @@ -722,6 +720,8 @@ func (s *SourceState) ForEach(f func(RelPath, SourceStateEntry) error) error { // Ignore returns if targetRelPath should be ignored. func (s *SourceState) Ignore(targetRelPath RelPath) bool { + s.Lock() + defer s.Unlock() return s.ignore.match(targetRelPath.String()) } @@ -1061,18 +1061,18 @@ func (s *SourceState) TargetRelPaths() []RelPath { return targetRelPaths } -// TemplateData returns s's template data. +// TemplateData returns a copy of s's template data. func (s *SourceState) TemplateData() map[string]interface{} { - if s.templateData == nil { - s.templateData = make(map[string]interface{}) - if s.defaultTemplateDataFunc != nil { - RecursiveMerge(s.templateData, s.defaultTemplateDataFunc()) - s.defaultTemplateDataFunc = nil - } - RecursiveMerge(s.templateData, s.userTemplateData) - RecursiveMerge(s.templateData, s.priorityTemplateData) - } - return s.templateData + s.Lock() + defer s.Unlock() + templateData := make(map[string]interface{}) + if s.defaultTemplateDataFunc != nil { + RecursiveMerge(templateData, s.defaultTemplateDataFunc()) + s.defaultTemplateDataFunc = nil + } + RecursiveMerge(templateData, s.userTemplateData) + RecursiveMerge(templateData, s.priorityTemplateData) + return templateData } // addExternal adds external source entries to s. @@ -1117,6 +1117,10 @@ func (s *SourceState) addPatterns(patternSet *patternSet, sourceAbsPath AbsPath, if err != nil { return err } + + s.Lock() + defer s.Unlock() + dir := sourceRelPath.Dir().TargetRelPath("") scanner := bufio.NewScanner(bytes.NewReader(data)) lineNumber := 0 diff --git a/pkg/chezmoi/sourcestate_test.go b/pkg/chezmoi/sourcestate_test.go index 2c09fd1bbd0..801322d04ae 100644 --- a/pkg/chezmoi/sourcestate_test.go +++ b/pkg/chezmoi/sourcestate_test.go @@ -1335,7 +1335,6 @@ func TestSourceStateRead(t *testing.T) { requireEvaluateAll(t, tc.expectedSourceState, system) s.baseSystem = nil s.system = nil - s.templateData = nil s.version = semver.Version{} assert.Equal(t, tc.expectedSourceState, s) }) diff --git a/pkg/cmd/testdata/scripts/issue1869.txt b/pkg/cmd/testdata/scripts/issue1869.txt new file mode 100644 index 00000000000..e97e95cd07c --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue1869.txt @@ -0,0 +1,29 @@ +# test concurrent read when there are multiple .chezmoiignore files +chezmoi status + +-- home/user/.local/share/chezmoi/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir1/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir1/subdir1/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir1/subdir2/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir1/subdir3/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir2/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir2/subdir1/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir2/subdir2/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir2/subdir3/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir3/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir3/subdir1/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir3/subdir2/.chezmoiignore -- +pattern +-- home/user/.local/share/chezmoi/dir3/subdir3/.chezmoiignore -- +pattern
fix
Fix race condition with multiple .chezmoiignore files
0584be710b76160014532065a4f94e76dce0d4f2
2023-02-01 15:52:49
dependabot[bot]
chore(deps): bump goreleaser/goreleaser-action from 4.1.0 to 4.2.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c50252a6633..4e5b1ad58b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -204,7 +204,7 @@ jobs: make create-syso - name: build-release if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 + uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b with: version: latest args: release --skip-publish --skip-sign --snapshot --timeout=1h @@ -416,7 +416,7 @@ jobs: - name: create-syso run: | make create-syso - - uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 + - uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b with: version: latest args: release --timeout=1h
chore
bump goreleaser/goreleaser-action from 4.1.0 to 4.2.0
e646140aa40fe4d8bfce07886c3c278ccb7c414e
2022-02-06 22:35:46
Tom Payne
chore: Add internal execute-template tool
false
diff --git a/internal/cmds/execute-template/main.go b/internal/cmds/execute-template/main.go new file mode 100644 index 00000000000..5a11b0ca4f4 --- /dev/null +++ b/internal/cmds/execute-template/main.go @@ -0,0 +1,67 @@ +package main + +import ( + "bytes" + "flag" + "fmt" + "os" + "path" + "text/template" + + "github.com/Masterminds/sprig/v3" + "github.com/google/renameio/v2/maybe" + "gopkg.in/yaml.v3" +) + +var ( + templateDataFilename = flag.String("data", "", "data filename") + outputFilename = flag.String("output", "", "output filename") +) + +func run() error { + flag.Parse() + + var templateData interface{} + if *templateDataFilename != "" { + dataBytes, err := os.ReadFile(*templateDataFilename) + if err != nil { + return err + } + if err := yaml.Unmarshal(dataBytes, &templateData); err != nil { + return err + } + } + + if flag.NArg() == 0 { + return fmt.Errorf("no arguments") + } + + templateName := path.Base(flag.Arg(0)) + buffer := &bytes.Buffer{} + tmpl, err := template.New(templateName).Funcs(sprig.TxtFuncMap()).ParseFiles(flag.Args()...) + if err != nil { + return err + } + if err := tmpl.Execute(buffer, templateData); err != nil { + return err + } + + if *outputFilename == "" { + if _, err := os.Stdout.Write(buffer.Bytes()); err != nil { + return err + } + } else if data, err := os.ReadFile(*outputFilename); err != nil || !bytes.Equal(data, buffer.Bytes()) { + if err := maybe.WriteFile(*outputFilename, buffer.Bytes(), 0o666); err != nil { + return err + } + } + + return nil +} + +func main() { + if err := run(); err != nil { + fmt.Println(err) + os.Exit(1) + } +}
chore
Add internal execute-template tool
255846e75fe2d3bf304acfe8b80b9adb4aa41a46
2024-05-14 02:44:16
Tom Payne
chore: Remove unused variable
false
diff --git a/internal/chezmoi/realsystem_windows.go b/internal/chezmoi/realsystem_windows.go index 6810007e968..844c1947df1 100644 --- a/internal/chezmoi/realsystem_windows.go +++ b/internal/chezmoi/realsystem_windows.go @@ -13,7 +13,6 @@ import ( type RealSystem struct { fileSystem vfs.FS createScriptTempDirOnce sync.Once - scriptEnv []string scriptTempDir AbsPath }
chore
Remove unused variable
531bb7a4d99ccd4acf4238df49740b2fa3757be3
2024-11-11 17:40:09
Ruslan Sayfutdinov
chore: Upload cache only from test jobs
false
diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml new file mode 100644 index 00000000000..bca65bda73b --- /dev/null +++ b/.github/actions/setup-go/action.yml @@ -0,0 +1,54 @@ +name: setup-go +description: Set up Go environment and enable caching +inputs: + cache-prefix: + description: Cache prefix + default: cache-go + required: false + go-version: + description: Go version to set up + required: true + upload-cache: + description: Upload cache or only restore + default: 'true' + required: false +runs: + using: composite + steps: + - name: setup-go-env + shell: bash + run: | + if [ "$RUNNER_OS" = "Windows" ]; then + echo "GOCACHE=D:\\golang\\cache" >> $GITHUB_ENV + echo "GOMODCACHE=D:\\golang\\modcache" >> $GITHUB_ENV + echo "GOPATH=D:\\golang\\go" >> $GITHUB_ENV + echo "USERPROFILE=D:\\homedir" >> $GITHUB_ENV + elif [ "$RUNNER_OS" = "macOS" ]; then + echo "GOCACHE=/Users/runner/go/pkg/mod" >> $GITHUB_ENV + echo "GOMODCACHE=/Users/runner/Library/Caches/go-build" >> $GITHUB_ENV + else + echo "GOCACHE=/home/runner/go/pkg/mod" >> $GITHUB_ENV + echo "GOMODCACHE=/home/runner/.cache/go-build" >> $GITHUB_ENV + fi + - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a + if: ${{ inputs.upload-cache == 'true' }} + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOMODCACHE }} + key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}- + - uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a + if: ${{ inputs.upload-cache != 'true' }} + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOMODCACHE }} + key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}- + - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + with: + cache: false + go-version: ${{ inputs.go-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25408e66d05..df6b29a2a71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,14 +65,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 1 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a + - uses: ./.github/actions/setup-go with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}- + go-version: ${{ env.GO_VERSION }} + upload-cache: false - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd with: languages: go @@ -132,12 +128,12 @@ jobs: test-macos: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - runs-on: macos-13 + runs-on: macos-15 permissions: contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: go-version: ${{ env.GO_VERSION }} - name: build @@ -207,17 +203,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a - with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - release-go-${{ runner.os }}-${{ env.GO_VERSION }}- - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: - cache: false + cache-prefix: release-go go-version: ${{ env.GO_VERSION }} - name: install-release-dependencies if: github.event_name == 'push' || needs.changes.outputs.code == 'true' @@ -269,6 +257,7 @@ jobs: name: chezmoi-windows-amd64 path: dist/chezmoi-nocgo_windows_amd64_v1/chezmoi.exe test-ubuntu: + name: test-ubuntu-umask${{ matrix.umask }} strategy: fail-fast: false matrix: @@ -276,24 +265,15 @@ jobs: - "022" - "002" needs: changes - runs-on: ubuntu-20.04 # use older Ubuntu for older glibc + runs-on: ubuntu-22.04 permissions: contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a + - uses: ./.github/actions/setup-go with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}- - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed - with: - cache: false go-version: ${{ env.GO_VERSION }} - name: install-age if: github.event_name == 'push' || needs.changes.outputs.code == 'true' @@ -326,17 +306,9 @@ jobs: contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a + - uses: ./.github/actions/setup-go with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - website-go-${{ runner.os }}-${{ env.GO_VERSION }}- - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed - with: - cache: false + cache-prefix: website-go go-version: ${{ env.GO_VERSION }} - uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992 with: @@ -356,13 +328,9 @@ jobs: runs-on: windows-2022 permissions: contents: read - env: - GOPATH: 'D:\golang\go' - GOCACHE: 'D:\golang\cache' - GOMODCACHE: 'D:\golang\modcache' steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: go-version: ${{ env.GO_VERSION }} - name: build @@ -384,9 +352,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: go-version: ${{ env.GO_VERSION }} + upload-cache: false - name: generate run: | go generate @@ -428,7 +397,7 @@ jobs: fail-fast: false matrix: runs-on: - - macos-14 + - macos-15 - ubuntu-22.04 - windows-2022 needs: changes @@ -436,16 +405,12 @@ jobs: runs-on: ${{ matrix.runs-on }} permissions: contents: read - env: - GOPATH: ${{ startsWith(matrix.runs-on, 'windows') && 'D:\golang\go' || '' }} - GOCACHE: ${{ startsWith(matrix.runs-on, 'windows') && 'D:\golang\cache' || '' }} - GOMODCACHE: ${{ startsWith(matrix.runs-on, 'windows') && 'D:\golang\modcache' || '' }} - USERPROFILE: ${{ startsWith(matrix.runs-on, 'windows') && 'D:\homedir' || '' }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: - go-version: stable + go-version: ${{ env.GO_VERSION }} + upload-cache: false - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 with: version: v${{ env.GOLANGCI_LINT_VERSION }} @@ -483,17 +448,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a + - uses: ./.github/actions/setup-go with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: release-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - release-go-${{ runner.os }}-${{ env.GO_VERSION }}- - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed - with: - cache: false + cache-prefix: release-go go-version: ${{ env.GO_VERSION }} - uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da - name: create-syso @@ -520,17 +477,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a - with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build - key: website-go-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - website-go-${{ runner.os }}-${{ env.GO_VERSION }}- - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: ./.github/actions/setup-go with: - cache: false + cache-prefix: website-go go-version: ${{ env.GO_VERSION }} - uses: astral-sh/setup-uv@2e657c127d5b1635d5a8e3fa40e0ac50a5bf6992 with:
chore
Upload cache only from test jobs
3a3dd1387aa077d08279e9165746db53a055a411
2024-04-01 00:20:06
Tom Payne
docs: Add links to articles
false
diff --git a/assets/chezmoi.io/docs/links/articles.md.yaml b/assets/chezmoi.io/docs/links/articles.md.yaml index e24b97c921a..43b8f6edef6 100644 --- a/assets/chezmoi.io/docs/links/articles.md.yaml +++ b/assets/chezmoi.io/docs/links/articles.md.yaml @@ -394,3 +394,16 @@ articles: lang: CN title: 'Chezmoi:優雅管理Linux的dotfile,使用Git儲存庫備份,類似GNU Stow' url: https://ivonblog.com/posts/chezmoi-manage-dotfiles/ +- date: '2024-03-23' + version: 2.47.2 + lang: CN + title: '使用 chezmoi & vscode, 管理你的 dotfiles' + url: https://shansan.top/2024/03/23/using-chezmoi-to-manage-dotfiles/ +- date: '2024-03-23' + version: 2.47.2 + title: A tour around chezmoi + url: https://www.rousette.org.uk/archives/a-tour-around-chezmoi/ +- date: '2024-03-25' + version: 2.47.2 + title: Whatever happened to dotfiles? + url: https://ryan0x44.substack.com/p/whatever-happened-to-dotfiles
docs
Add links to articles
cb162d6bb5af0e32b4929b3c9786bcd737eb2f63
2024-04-27 00:12:09
Tom Payne
chore: Update GitHub Actions
false
diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index f2b3aa78727..63f6673acb6 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -16,7 +16,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: go-version id: go-version run: | diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index a48376be63a..614a7597436 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -17,7 +17,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - id: filter uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 with: @@ -36,7 +36,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: reviewdog/action-misspell@5bd7be2fc7ae56a517184f5c4bbcf2fd7afe3927 with: locale: US @@ -50,7 +50,7 @@ jobs: env: BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: test-${{ matrix.os }}-local shell: bash run: | @@ -73,7 +73,7 @@ jobs: env: BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: test-${{ matrix.os }}-local shell: pwsh run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5863901a7b..7e00406afc0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - id: filter uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 with: @@ -56,7 +56,7 @@ jobs: permissions: security-events: write steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 1 - uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 @@ -68,7 +68,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: reviewdog/action-misspell@5bd7be2fc7ae56a517184f5c4bbcf2fd7afe3927 with: locale: US @@ -79,7 +79,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -92,7 +92,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -105,7 +105,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} @@ -140,7 +140,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: oldstable @@ -173,7 +173,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 @@ -238,7 +238,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 @@ -280,7 +280,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} @@ -298,7 +298,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} @@ -324,7 +324,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 @@ -372,7 +372,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} @@ -414,7 +414,7 @@ jobs: run: snapcraft whoami env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 @@ -442,7 +442,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b with: fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
chore
Update GitHub Actions
ee583c5de5eb025743e8ddfccd1d04637440c238
2021-11-20 07:11:45
Tom Payne
chore: Fix link in reference guide
false
diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index d1793e2a986..0d5fa3afd31 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -106,7 +106,7 @@ Manage your dotfiles across multiple machines, securely. * [`decrypt` *ciphertext*](#decrypt-ciphertext) * [`encrypt` *plaintext*](#encrypt-plaintext) * [`gitHubKeys` *user*](#githubkeys-user) - * [`gitHubLatestRelease` *user-repo*](#githubkeys-user-repo) + * [`gitHubLatestRelease` *user-repo*](#githublatestrelease-user-repo) * [`gopass` *gopass-name*](#gopass-gopass-name) * [`gopassRaw` *gopass-name*](#gopassraw-gopass-name) * [`include` *filename*](#include-filename)
chore
Fix link in reference guide
7ae528fdb9b080e97ab4b87b1decc52adb99e57d
2023-12-26 22:14:26
Tom Payne
chore: Join some long lines
false
diff --git a/Makefile b/Makefile index ec0984a7e38..a4927bff1eb 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ lint: ensure-actionlint ensure-editorconfig-checker ensure-find-typos ensure-gol .PHONY: format format: ensure-gofumpt ensure-golines - find . -name \*.go | xargs ./bin/golines --base-formatter="./bin/gofumpt -extra" -w + find . -name \*.go | xargs ./bin/golines --base-formatter="./bin/gofumpt -extra" --max-len=128 --write-output find . -name \*.txtar | xargs ${GO} run ./internal/cmds/lint-txtar -w .PHONY: format-yaml diff --git a/internal/chezmoi/actualstateentry.go b/internal/chezmoi/actualstateentry.go index 340f9bfed36..131e3cb43d6 100644 --- a/internal/chezmoi/actualstateentry.go +++ b/internal/chezmoi/actualstateentry.go @@ -40,12 +40,7 @@ type ActualStateSymlink struct { // NewActualStateEntry returns a new ActualStateEntry populated with absPath // from system. -func NewActualStateEntry( - system System, - absPath AbsPath, - fileInfo fs.FileInfo, - err error, -) (ActualStateEntry, error) { +func NewActualStateEntry(system System, absPath AbsPath, fileInfo fs.FileInfo, err error) (ActualStateEntry, error) { if fileInfo == nil { fileInfo, err = system.Lstat(absPath) } diff --git a/internal/chezmoi/ageencryption.go b/internal/chezmoi/ageencryption.go index a9785aabd3c..1c85dd0e563 100644 --- a/internal/chezmoi/ageencryption.go +++ b/internal/chezmoi/ageencryption.go @@ -84,9 +84,8 @@ func (e *AgeEncryption) EncryptFile(plaintextAbsPath AbsPath) ([]byte, error) { return e.builtinEncrypt(plaintext) } - cmd := exec.Command( //nolint:gosec - e.Command, - append(append(e.encryptArgs(), e.Args...), plaintextAbsPath.String())...) + args := append(append(e.encryptArgs(), e.Args...), plaintextAbsPath.String()) + cmd := exec.Command(e.Command, args...) //nolint:gosec cmd.Stderr = os.Stderr return chezmoilog.LogCmdOutput(cmd) } diff --git a/internal/chezmoi/archivereadersystem.go b/internal/chezmoi/archivereadersystem.go index c4ffe604872..14113d0a585 100644 --- a/internal/chezmoi/archivereadersystem.go +++ b/internal/chezmoi/archivereadersystem.go @@ -26,7 +26,10 @@ type ArchiveReaderSystemOptions struct { // NewArchiveReaderSystem returns a new ArchiveReaderSystem reading from data // and using archivePath as a hint for the archive format. func NewArchiveReaderSystem( - archivePath string, data []byte, format ArchiveFormat, options ArchiveReaderSystemOptions, + archivePath string, + data []byte, + format ArchiveFormat, + options ArchiveReaderSystemOptions, ) (*ArchiveReaderSystem, error) { s := &ArchiveReaderSystem{ fileInfos: make(map[AbsPath]fs.FileInfo), diff --git a/internal/chezmoi/archivereadersystem_test.go b/internal/chezmoi/archivereadersystem_test.go index 759047103ff..635d2157f4a 100644 --- a/internal/chezmoi/archivereadersystem_test.go +++ b/internal/chezmoi/archivereadersystem_test.go @@ -21,15 +21,11 @@ func TestArchiveReaderSystemTar(t *testing.T) { }) assert.NoError(t, err) - archiveReaderSystem, err := NewArchiveReaderSystem( - "archive.tar", - data, - ArchiveFormatTar, - ArchiveReaderSystemOptions{ - RootAbsPath: NewAbsPath("/home/user"), - StripComponents: 1, - }, - ) + options := ArchiveReaderSystemOptions{ + RootAbsPath: NewAbsPath("/home/user"), + StripComponents: 1, + } + archiveReaderSystem, err := NewArchiveReaderSystem("archive.tar", data, ArchiveFormatTar, options) assert.NoError(t, err) for _, tc := range []struct { diff --git a/internal/chezmoi/autotemplate.go b/internal/chezmoi/autotemplate.go index 4e05dec03c2..42c984e61e6 100644 --- a/internal/chezmoi/autotemplate.go +++ b/internal/chezmoi/autotemplate.go @@ -105,9 +105,7 @@ func autoTemplate(contents []byte, data map[string]any) ([]byte, bool) { // appendVariables appends all template variables in data to variables // and returns variables. data is assumed to be rooted at parent. -func appendVariables( - variables []templateVariable, parent []string, data map[string]any, -) []templateVariable { +func appendVariables(variables []templateVariable, parent []string, data map[string]any) []templateVariable { for name, value := range data { switch value := value.(type) { case string: diff --git a/internal/chezmoi/boltpersistentstate.go b/internal/chezmoi/boltpersistentstate.go index 08c00c2f700..c2966d269e1 100644 --- a/internal/chezmoi/boltpersistentstate.go +++ b/internal/chezmoi/boltpersistentstate.go @@ -31,11 +31,7 @@ type BoltPersistentState struct { } // NewBoltPersistentState returns a new BoltPersistentState. -func NewBoltPersistentState( - system System, - path AbsPath, - mode BoltPersistentStateMode, -) (*BoltPersistentState, error) { +func NewBoltPersistentState(system System, path AbsPath, mode BoltPersistentStateMode) (*BoltPersistentState, error) { empty := false switch _, err := system.Stat(path); { case errors.Is(err, fs.ErrNotExist): diff --git a/internal/chezmoi/boltpersistentstate_test.go b/internal/chezmoi/boltpersistentstate_test.go index 257eddfd991..ac1972295c2 100644 --- a/internal/chezmoi/boltpersistentstate_test.go +++ b/internal/chezmoi/boltpersistentstate_test.go @@ -140,11 +140,8 @@ func TestBoltPersistentStateGeneric(t *testing.T) { testPersistentState(t, func() PersistentState { tempDir, err := os.MkdirTemp("", "chezmoi-test") assert.NoError(t, err) - b, err := NewBoltPersistentState( - system, - NewAbsPath(tempDir).JoinString("chezmoistate.boltdb"), - BoltPersistentStateReadWrite, - ) + absPath := NewAbsPath(tempDir).JoinString("chezmoistate.boltdb") + b, err := NewBoltPersistentState(system, absPath, BoltPersistentStateReadWrite) assert.NoError(t, err) return b }) diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 0e7f989bcbb..ccd7e424596 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -160,9 +160,7 @@ func FQDNHostname(fileSystem vfs.FS) (string, error) { } // FlagCompletionFunc returns a flag completion function. -func FlagCompletionFunc(allCompletions []string) func(*cobra.Command, []string, string) ( - []string, cobra.ShellCompDirective, -) { +func FlagCompletionFunc(allCompletions []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) { return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { var completions []string for _, completion := range allCompletions { @@ -201,9 +199,8 @@ func SuspiciousSourceDirEntry(base string, fileInfo fs.FileInfo, encryptedSuffix return true } for _, encryptedSuffix := range encryptedSuffixes { - if fileAttr := parseFileAttr(fileInfo.Name(), encryptedSuffix); knownTargetFiles.contains( - fileAttr.TargetName, - ) { + fileAttr := parseFileAttr(fileInfo.Name(), encryptedSuffix) + if knownTargetFiles.contains(fileAttr.TargetName) { return true } } diff --git a/internal/chezmoi/debugpersistentstate.go b/internal/chezmoi/debugpersistentstate.go index 41e02478e28..b877e38ed66 100644 --- a/internal/chezmoi/debugpersistentstate.go +++ b/internal/chezmoi/debugpersistentstate.go @@ -12,10 +12,7 @@ type DebugPersistentState struct { // NewDebugPersistentState returns a new debugPersistentState that logs methods // on persistentState to logger. -func NewDebugPersistentState( - persistentState PersistentState, - logger *zerolog.Logger, -) *DebugPersistentState { +func NewDebugPersistentState(persistentState PersistentState, logger *zerolog.Logger) *DebugPersistentState { return &DebugPersistentState{ logger: logger, persistentState: persistentState, diff --git a/internal/chezmoi/debugsystem.go b/internal/chezmoi/debugsystem.go index beb03b80cfd..8d7604487fa 100644 --- a/internal/chezmoi/debugsystem.go +++ b/internal/chezmoi/debugsystem.go @@ -159,12 +159,7 @@ func (s *DebugSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *DebugSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *DebugSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { err := s.system.RunScript(scriptname, dir, data, options) s.logger.Err(err). Stringer("scriptname", scriptname). diff --git a/internal/chezmoi/diff.go b/internal/chezmoi/diff.go index 7e82492cc9c..346a29b699d 100644 --- a/internal/chezmoi/diff.go +++ b/internal/chezmoi/diff.go @@ -64,11 +64,7 @@ func (p *gitDiffPatch) Message() string { return p.message } // DiffPatch returns a github.com/go-git/go-git/plumbing/format/diff.Patch for // path from the given data and mode to the given data and mode. -func DiffPatch( - path RelPath, - fromData []byte, fromMode fs.FileMode, - toData []byte, toMode fs.FileMode, -) (diff.Patch, error) { +func DiffPatch(path RelPath, fromData []byte, fromMode fs.FileMode, toData []byte, toMode fs.FileMode) (diff.Patch, error) { isBinary := isBinary(fromData) || isBinary(toData) var from diff.File diff --git a/internal/chezmoi/dryrunsystem.go b/internal/chezmoi/dryrunsystem.go index f8abfbc6931..5b3b9279506 100644 --- a/internal/chezmoi/dryrunsystem.go +++ b/internal/chezmoi/dryrunsystem.go @@ -107,12 +107,7 @@ func (s *DryRunSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *DryRunSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *DryRunSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { s.setModified() return nil } diff --git a/internal/chezmoi/dumpsystem.go b/internal/chezmoi/dumpsystem.go index e44d5d5cb48..d331439ab5c 100644 --- a/internal/chezmoi/dumpsystem.go +++ b/internal/chezmoi/dumpsystem.go @@ -98,12 +98,7 @@ func (s *DumpSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *DumpSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *DumpSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { scriptnameStr := scriptname.String() scriptData := &scriptData{ Type: dataTypeScript, diff --git a/internal/chezmoi/dumpsystem_test.go b/internal/chezmoi/dumpsystem_test.go index b4a97e67c8f..332b351515f 100644 --- a/internal/chezmoi/dumpsystem_test.go +++ b/internal/chezmoi/dumpsystem_test.go @@ -49,12 +49,10 @@ func TestDumpSystem(t *testing.T) { dumpSystem := NewDumpSystem() persistentState := NewMockPersistentState() - assert.NoError( - t, - s.applyAll(dumpSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ - Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), - }), - ) + err := s.applyAll(dumpSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ + Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), + }) + assert.NoError(t, err) expectedData := map[string]any{ ".dir": &dirData{ Type: dataTypeDir, diff --git a/internal/chezmoi/entrytypeset.go b/internal/chezmoi/entrytypeset.go index 03131336bf7..3374e5e6bcb 100644 --- a/internal/chezmoi/entrytypeset.go +++ b/internal/chezmoi/entrytypeset.go @@ -371,9 +371,7 @@ func StringSliceToEntryTypeSetHookFunc() mapstructure.DecodeHookFunc { } // EntryTypeSetFlagCompletionFunc completes EntryTypeSet flags. -func EntryTypeSetFlagCompletionFunc( - cmd *cobra.Command, args []string, toComplete string, -) ([]string, cobra.ShellCompDirective) { +func EntryTypeSetFlagCompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { var completions []string entryTypes := strings.Split(toComplete, ",") lastEntryType := entryTypes[len(entryTypes)-1] diff --git a/internal/chezmoi/entrytypeset_test.go b/internal/chezmoi/entrytypeset_test.go index dfb08aace6c..f162bb710c2 100644 --- a/internal/chezmoi/entrytypeset_test.go +++ b/internal/chezmoi/entrytypeset_test.go @@ -149,17 +149,10 @@ func TestEntryTypeSetFlagCompletionFunc(t *testing.T) { }, } { t.Run(tc.toComplete, func(t *testing.T) { - completions, shellCompDirective := EntryTypeSetFlagCompletionFunc( - nil, - nil, - tc.toComplete, - ) + completions, shellCompDirective := EntryTypeSetFlagCompletionFunc(nil, nil, tc.toComplete) assert.Equal(t, tc.expectedCompletions, completions) - assert.Equal( - t, - cobra.ShellCompDirectiveNoSpace|cobra.ShellCompDirectiveNoFileComp, - shellCompDirective, - ) + expectedShellCompDirective := cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp + assert.Equal(t, expectedShellCompDirective, shellCompDirective) }) } } diff --git a/internal/chezmoi/erroronwritesystem.go b/internal/chezmoi/erroronwritesystem.go index 0df465b38cf..b7e952bdbe3 100644 --- a/internal/chezmoi/erroronwritesystem.go +++ b/internal/chezmoi/erroronwritesystem.go @@ -95,12 +95,7 @@ func (s *ErrorOnWriteSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *ErrorOnWriteSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *ErrorOnWriteSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { return s.err } diff --git a/internal/chezmoi/errors.go b/internal/chezmoi/errors.go index 38057ca4879..22555b98a79 100644 --- a/internal/chezmoi/errors.go +++ b/internal/chezmoi/errors.go @@ -24,11 +24,8 @@ type TooOldError struct { } func (e *TooOldError) Error() string { - return fmt.Sprintf( - "source state requires chezmoi version %s or later, chezmoi is version %s", - e.Need, - e.Have, - ) + format := "source state requires chezmoi version %s or later, chezmoi is version %s" + return fmt.Sprintf(format, e.Need, e.Have) } type inconsistentStateError struct { @@ -37,11 +34,8 @@ type inconsistentStateError struct { } func (e *inconsistentStateError) Error() string { - return fmt.Sprintf( - "%s: inconsistent state (%s)", - e.targetRelPath, - strings.Join(e.origins, ", "), - ) + format := "%s: inconsistent state (%s)" + return fmt.Sprintf(format, e.targetRelPath, strings.Join(e.origins, ", ")) } type NotInAbsDirError struct { diff --git a/internal/chezmoi/externaldiffsystem.go b/internal/chezmoi/externaldiffsystem.go index 8882ab5f001..d50f45b6a59 100644 --- a/internal/chezmoi/externaldiffsystem.go +++ b/internal/chezmoi/externaldiffsystem.go @@ -181,12 +181,7 @@ func (s *ExternalDiffSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *ExternalDiffSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *ExternalDiffSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { bits := EntryTypeScripts if options.Condition == ScriptConditionAlways { bits |= EntryTypeAlways diff --git a/internal/chezmoi/findexecutable_darwin_test.go b/internal/chezmoi/findexecutable_darwin_test.go index 05a752341f1..42c74fd1229 100644 --- a/internal/chezmoi/findexecutable_darwin_test.go +++ b/internal/chezmoi/findexecutable_darwin_test.go @@ -47,12 +47,8 @@ func TestFindExecutable(t *testing.T) { } for _, test := range tests { - name := fmt.Sprintf( - "FindExecutable %#v in %#v as %#v", - test.files, - test.paths, - test.expected, - ) + format := "FindExecutable %#v in %#v as %#v" + name := fmt.Sprintf(format, test.files, test.paths, test.expected) t.Run(name, func(t *testing.T) { actual, err := FindExecutable(test.files, test.paths) assert.NoError(t, err) diff --git a/internal/chezmoi/findexecutable_unix_test.go b/internal/chezmoi/findexecutable_unix_test.go index 8e1cb6e6361..f25d133fb8d 100644 --- a/internal/chezmoi/findexecutable_unix_test.go +++ b/internal/chezmoi/findexecutable_unix_test.go @@ -48,12 +48,8 @@ func TestFindExecutable(t *testing.T) { } for _, test := range tests { - name := fmt.Sprintf( - "FindExecutable %#v in %#v as %#v", - test.files, - test.paths, - test.expected, - ) + format := "FindExecutable %#v in %#v as %#v" + name := fmt.Sprintf(format, test.files, test.paths, test.expected) t.Run(name, func(t *testing.T) { actual, err := FindExecutable(test.files, test.paths) assert.NoError(t, err) diff --git a/internal/chezmoi/gitdiffsystem.go b/internal/chezmoi/gitdiffsystem.go index f0e7a39152c..fd5068d0df6 100644 --- a/internal/chezmoi/gitdiffsystem.go +++ b/internal/chezmoi/gitdiffsystem.go @@ -41,12 +41,7 @@ type GitDiffSystemOptions struct { // NewGitDiffSystem returns a new GitDiffSystem. Output is written to w, the // dirAbsPath is stripped from paths, and color controls whether the output // contains ANSI color escape sequences. -func NewGitDiffSystem( - system System, - w io.Writer, - dirAbsPath AbsPath, - options *GitDiffSystemOptions, -) *GitDiffSystem { +func NewGitDiffSystem(system System, w io.Writer, dirAbsPath AbsPath, options *GitDiffSystemOptions) *GitDiffSystem { unifiedEncoder := diff.NewUnifiedEncoder(w, diff.DefaultContextLines) if options.Color { unifiedEncoder.SetColor(diff.NewColorConfig()) @@ -206,12 +201,7 @@ func (s *GitDiffSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *GitDiffSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *GitDiffSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { bits := EntryTypeScripts if options.Condition == ScriptConditionAlways { bits |= EntryTypeAlways diff --git a/internal/chezmoi/glob.go b/internal/chezmoi/glob.go index 21dab1980dd..b0aa98d8300 100644 --- a/internal/chezmoi/glob.go +++ b/internal/chezmoi/glob.go @@ -28,12 +28,10 @@ func (s lstatFS) Stat(name string) (fs.FileInfo, error) { // Glob is like github.com/bmatcuk/doublestar/v4.Glob except that it does not // follow symlinks. func Glob(fileSystem vfs.FS, prefix string) ([]string, error) { - return doublestar.Glob( - lstatFS{ - wrapped: fileSystem, - }, - prefix, + fsys := lstatFS{wrapped: fileSystem} + opts := []doublestar.GlobOption{ doublestar.WithFailOnIOErrors(), doublestar.WithNoFollow(), - ) + } + return doublestar.Glob(fsys, prefix, opts...) } diff --git a/internal/chezmoi/realsystem.go b/internal/chezmoi/realsystem.go index a93330983e0..7f52a303ca8 100644 --- a/internal/chezmoi/realsystem.go +++ b/internal/chezmoi/realsystem.go @@ -83,12 +83,7 @@ func (s *RealSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *RealSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) (err error) { +func (s *RealSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) (err error) { // Create the script temporary directory, if needed. s.createScriptTempDirOnce.Do(func() { if !s.scriptTempDir.Empty() { diff --git a/internal/chezmoi/refreshexternals.go b/internal/chezmoi/refreshexternals.go index b78dcd82b7c..b23e0393bb6 100644 --- a/internal/chezmoi/refreshexternals.go +++ b/internal/chezmoi/refreshexternals.go @@ -22,9 +22,7 @@ var ( "never": RefreshExternalsNever, } - RefreshExternalsFlagCompletionFunc = FlagCompletionFunc( - maps.Keys(refreshExternalsWellKnownStrings), - ) + RefreshExternalsFlagCompletionFunc = FlagCompletionFunc(maps.Keys(refreshExternalsWellKnownStrings)) ) func (re *RefreshExternals) Set(s string) error { diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 63dd35878dd..3dd6187d13d 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -49,10 +49,8 @@ const ( ) var ( - lineEndingRx = regexp.MustCompile(`(?m)(?:\r\n|\r|\n)`) - modifyTemplateRx = regexp.MustCompile( - `(?m)^.*chezmoi:modify-template.*$(?:\r?\n)?`, - ) + lineEndingRx = regexp.MustCompile(`(?m)(?:\r\n|\r|\n)`) + modifyTemplateRx = regexp.MustCompile(`(?m)^.*chezmoi:modify-template.*$(?:\r?\n)?`) templateDirectiveRx = regexp.MustCompile(`(?m)^.*?chezmoi:template:(.*)$(?:\r?\n)?`) templateDirectiveKeyValuePairRx = regexp.MustCompile(`\s*(\S+)=("(?:[^"]|\\")*"|\S+)`) @@ -369,11 +367,8 @@ func (s *SourceState) Add( continue } if strings.HasPrefix(destAbsPath.String(), protectedAbsPath.String()) { - return fmt.Errorf( - "%s: cannot add chezmoi file to chezmoi (%s is protected)", - destAbsPath, - protectedAbsPath, - ) + format := "%s: cannot add chezmoi file to chezmoi (%s is protected)" + return fmt.Errorf(format, destAbsPath, protectedAbsPath) } } } @@ -692,12 +687,7 @@ func (s *SourceState) Apply( if options.PreApplyFunc != nil { var lastWrittenEntryState *EntryState var entryState EntryState - ok, err := PersistentStateGet( - persistentState, - EntryStateBucket, - targetAbsPath.Bytes(), - &entryState, - ) + ok, err := PersistentStateGet(persistentState, EntryStateBucket, targetAbsPath.Bytes(), &entryState) if err != nil { return err } @@ -718,24 +708,14 @@ func (s *SourceState) Apply( // apply as the last written state. if targetEntryState.Equivalent(actualEntryState) && !lastWrittenEntryState.Equivalent(actualEntryState) { - err := PersistentStateSet( - persistentState, - EntryStateBucket, - targetAbsPath.Bytes(), - targetEntryState, - ) + err := PersistentStateSet(persistentState, EntryStateBucket, targetAbsPath.Bytes(), targetEntryState) if err != nil { return err } lastWrittenEntryState = targetEntryState } - err = options.PreApplyFunc( - targetRelPath, - targetEntryState, - lastWrittenEntryState, - actualEntryState, - ) + err = options.PreApplyFunc(targetRelPath, targetEntryState, lastWrittenEntryState, actualEntryState) if err != nil { return err } @@ -747,12 +727,7 @@ func (s *SourceState) Apply( return nil } - return PersistentStateSet( - persistentState, - EntryStateBucket, - targetAbsPath.Bytes(), - targetEntryState, - ) + return PersistentStateSet(persistentState, EntryStateBucket, targetAbsPath.Bytes(), targetEntryState) } // Encryption returns s's encryption. @@ -839,11 +814,7 @@ func (s *SourceState) MustEntry(targetRelPath RelPath) SourceStateEntry { } // PostApply performs all updates required after s.Apply. -func (s *SourceState) PostApply( - targetSystem System, - targetDirAbsPath AbsPath, - targetRelPaths RelPaths, -) error { +func (s *SourceState) PostApply(targetSystem System, targetDirAbsPath AbsPath, targetRelPaths RelPaths) error { // Remove empty directories with the remove_ attribute. This assumes that // targetRelPaths is already sorted and iterates in reverse order so that // children are removed before their parents. @@ -906,9 +877,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { addSourceStateEntries := func(relPath RelPath, sourceStateEntries ...SourceStateEntry) { allSourceStateEntriesMu.Lock() defer allSourceStateEntriesMu.Unlock() - allSourceStateEntries[relPath] = append( - allSourceStateEntries[relPath], - sourceStateEntries...) + allSourceStateEntries[relPath] = append(allSourceStateEntries[relPath], sourceStateEntries...) } walkFunc := func(sourceAbsPath AbsPath, fileInfo fs.FileInfo, err error) error { if err != nil { @@ -1035,12 +1004,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { return nil } var sourceStateEntry SourceStateEntry - targetRelPath, sourceStateEntry = s.newSourceStateFile( - sourceAbsPath, - sourceRelPath, - fa, - targetRelPath, - ) + targetRelPath, sourceStateEntry = s.newSourceStateFile(sourceAbsPath, sourceRelPath, fa, targetRelPath) addSourceStateEntries(targetRelPath, sourceStateEntry) return nil default: @@ -1077,13 +1041,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { case parentSourceStateEntry != nil: parentSourceRelPath = parentSourceStateEntry.SourceRelPath() } - externalSourceStateEntries, err := s.readExternal( - ctx, - externalRelPath, - parentSourceRelPath, - external, - options, - ) + externalSourceStateEntries, err := s.readExternal(ctx, externalRelPath, parentSourceRelPath, external, options) if err != nil { return err } @@ -1106,10 +1064,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } // Generate SourceStateRemoves for existing targets. - matches, err := s.remove.glob( - s.system.UnderlyingFS(), - ensureSuffix(s.destDirAbsPath.String(), "/"), - ) + matches, err := s.remove.glob(s.system.UnderlyingFS(), ensureSuffix(s.destDirAbsPath.String(), "/")) if err != nil { return err } @@ -1123,10 +1078,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { sourceRelPath: NewSourceRelPath(".chezmoiremove"), targetRelPath: targetRelPath, } - allSourceStateEntries[targetRelPath] = append( - allSourceStateEntries[targetRelPath], - sourceStateEntry, - ) + allSourceStateEntries[targetRelPath] = append(allSourceStateEntries[targetRelPath], sourceStateEntry) } // Generate SourceStateRemoves for exact directories. @@ -1398,11 +1350,7 @@ func (s *SourceState) addExternalDir(ctx context.Context, externalsDirAbsPath Ab // addPatterns executes the template at sourceAbsPath, interprets the result as // a list of patterns, and adds all patterns found to patternSet. -func (s *SourceState) addPatterns( - patternSet *patternSet, - sourceAbsPath AbsPath, - sourceRelPath SourceRelPath, -) error { +func (s *SourceState) addPatterns(patternSet *patternSet, sourceAbsPath AbsPath, sourceRelPath SourceRelPath) error { data, err := s.executeTemplate(sourceAbsPath) if err != nil { return err @@ -1558,7 +1506,10 @@ func (s *SourceState) executeTemplate(templateAbsPath AbsPath) ([]byte, error) { // getExternalDataRaw returns the raw data for external at externalRelPath, // possibly from the external cache. func (s *SourceState) getExternalDataRaw( - ctx context.Context, externalRelPath RelPath, external *External, options *ReadOptions, + ctx context.Context, + externalRelPath RelPath, + external *External, + options *ReadOptions, ) ([]byte, error) { var now time.Time if options != nil && options.TimeNow != nil { @@ -1633,7 +1584,10 @@ func (s *SourceState) getExternalDataRaw( // getExternalDataRaw reads the external data for externalRelPath from // external.URL. func (s *SourceState) getExternalData( - ctx context.Context, externalRelPath RelPath, external *External, options *ReadOptions, + ctx context.Context, + externalRelPath RelPath, + external *External, + options *ReadOptions, ) ([]byte, error) { data, err := s.getExternalDataRaw(ctx, externalRelPath, external, options) if err != nil { @@ -1644,39 +1598,38 @@ func (s *SourceState) getExternalData( if external.Checksum.Size != 0 { if len(data) != external.Checksum.Size { - errs = append(errs, fmt.Errorf("size mismatch: expected %d, got %d", - external.Checksum.Size, len(data))) + err := fmt.Errorf("size mismatch: expected %d, got %d", external.Checksum.Size, len(data)) + errs = append(errs, err) } } if external.Checksum.MD5 != nil { if gotMD5Sum := md5Sum(data); !bytes.Equal(gotMD5Sum, external.Checksum.MD5) { - errs = append(errs, fmt.Errorf("MD5 mismatch: expected %s, got %s", - external.Checksum.MD5, hex.EncodeToString(gotMD5Sum))) + err := fmt.Errorf("MD5 mismatch: expected %s, got %s", external.Checksum.MD5, hex.EncodeToString(gotMD5Sum)) + errs = append(errs, err) } } if external.Checksum.RIPEMD160 != nil { - if gotRIPEMD160Sum := ripemd160Sum(data); !bytes.Equal( - gotRIPEMD160Sum, - external.Checksum.RIPEMD160, - ) { - errs = append(errs, fmt.Errorf("RIPEMD-160 mismatch: expected %s, got %s", - external.Checksum.RIPEMD160, hex.EncodeToString(gotRIPEMD160Sum))) + if gotRIPEMD160Sum := ripemd160Sum(data); !bytes.Equal(gotRIPEMD160Sum, external.Checksum.RIPEMD160) { + format := "RIPEMD-160 mismatch: expected %s, got %s" + err := fmt.Errorf(format, external.Checksum.RIPEMD160, hex.EncodeToString(gotRIPEMD160Sum)) + errs = append(errs, err) } } if external.Checksum.SHA1 != nil { if gotSHA1Sum := sha1Sum(data); !bytes.Equal(gotSHA1Sum, external.Checksum.SHA1) { - errs = append(errs, fmt.Errorf("SHA1 mismatch: expected %s, got %s", - external.Checksum.SHA1, hex.EncodeToString(gotSHA1Sum))) + err := fmt.Errorf("SHA1 mismatch: expected %s, got %s", external.Checksum.SHA1, hex.EncodeToString(gotSHA1Sum)) + errs = append(errs, err) } } if external.Checksum.SHA256 != nil { if gotSHA256Sum := SHA256Sum(data); !bytes.Equal(gotSHA256Sum, external.Checksum.SHA256) { - errs = append(errs, fmt.Errorf("SHA256 mismatch: expected %s, got %s", - external.Checksum.SHA256, hex.EncodeToString(gotSHA256Sum))) + format := "SHA256 mismatch: expected %s, got %s" + err := fmt.Errorf(format, external.Checksum.SHA256, hex.EncodeToString(gotSHA256Sum)) + errs = append(errs, err) } } @@ -1719,11 +1672,7 @@ func (s *SourceState) getExternalData( } // newSourceStateDir returns a new SourceStateDir. -func (s *SourceState) newSourceStateDir( - absPath AbsPath, - sourceRelPath SourceRelPath, - dirAttr DirAttr, -) *SourceStateDir { +func (s *SourceState) newSourceStateDir(absPath AbsPath, sourceRelPath SourceRelPath, dirAttr DirAttr) *SourceStateDir { targetStateDir := &TargetStateDir{ perm: dirAttr.perm() &^ s.umask, } @@ -1739,7 +1688,9 @@ func (s *SourceState) newSourceStateDir( // file with sourceLazyContents if the file does not already exist, or returns // the actual file's contents unchanged if the file already exists. func (s *SourceState) newCreateTargetStateEntryFunc( - sourceRelPath SourceRelPath, fileAttr FileAttr, sourceLazyContents *lazyContents, + sourceRelPath SourceRelPath, + fileAttr FileAttr, + sourceLazyContents *lazyContents, ) targetStateEntryFunc { return func(destSystem System, destAbsPath AbsPath) (TargetStateEntry, error) { var lazyContents *lazyContents @@ -1782,7 +1733,9 @@ func (s *SourceState) newCreateTargetStateEntryFunc( // newFileTargetStateEntryFunc returns a targetStateEntryFunc that returns a // file with sourceLazyContents. func (s *SourceState) newFileTargetStateEntryFunc( - sourceRelPath SourceRelPath, fileAttr FileAttr, sourceLazyContents *lazyContents, + sourceRelPath SourceRelPath, + fileAttr FileAttr, + sourceLazyContents *lazyContents, ) targetStateEntryFunc { return func(destSystem System, destAbsPath AbsPath) (TargetStateEntry, error) { if s.mode == ModeSymlink && !fileAttr.Encrypted && !fileAttr.Executable && @@ -1794,9 +1747,7 @@ func (s *SourceState) newFileTargetStateEntryFunc( case isEmpty(contents) && !fileAttr.Empty: return &TargetStateRemove{}, nil default: - linkname := normalizeLinkname( - s.sourceDirAbsPath.Join(sourceRelPath.RelPath()).String(), - ) + linkname := normalizeLinkname(s.sourceDirAbsPath.Join(sourceRelPath.RelPath()).String()) return &TargetStateSymlink{ lazyLinkname: newLazyLinkname(linkname), sourceAttr: SourceAttr{ @@ -1939,9 +1890,7 @@ func (s *SourceState) newModifyTargetStateEntryFunc( // newRemoveTargetStateEntryFunc returns a targetStateEntryFunc that removes a // target. -func (s *SourceState) newRemoveTargetStateEntryFunc( - sourceRelPath SourceRelPath, fileAttr FileAttr, -) targetStateEntryFunc { +func (s *SourceState) newRemoveTargetStateEntryFunc(sourceRelPath SourceRelPath, fileAttr FileAttr) targetStateEntryFunc { return func(destSystem System, destAbsPath AbsPath) (TargetStateEntry, error) { return &TargetStateRemove{}, nil } @@ -1989,7 +1938,9 @@ func (s *SourceState) newScriptTargetStateEntryFunc( // newSymlinkTargetStateEntryFunc returns a targetStateEntryFunc that returns a // symlink with the linkname sourceLazyContents. func (s *SourceState) newSymlinkTargetStateEntryFunc( - sourceRelPath SourceRelPath, fileAttr FileAttr, sourceLazyContents *lazyContents, + sourceRelPath SourceRelPath, + fileAttr FileAttr, + sourceLazyContents *lazyContents, ) targetStateEntryFunc { return func(destSystem System, destAbsPath AbsPath) (TargetStateEntry, error) { linknameFunc := func() (string, error) { @@ -2019,7 +1970,10 @@ func (s *SourceState) newSymlinkTargetStateEntryFunc( // newSourceStateFile returns a possibly new target RalPath and a new // SourceStateFile. func (s *SourceState) newSourceStateFile( - absPath AbsPath, sourceRelPath SourceRelPath, fileAttr FileAttr, targetRelPath RelPath, + absPath AbsPath, + sourceRelPath SourceRelPath, + fileAttr FileAttr, + targetRelPath RelPath, ) (RelPath, *SourceStateFile) { sourceLazyContents := newLazyContentsFunc(func() ([]byte, error) { contents, err := s.system.ReadFile(s.sourceDirAbsPath.Join(sourceRelPath.RelPath())) @@ -2038,17 +1992,9 @@ func (s *SourceState) newSourceStateFile( var targetStateEntryFunc targetStateEntryFunc switch fileAttr.Type { case SourceFileTypeCreate: - targetStateEntryFunc = s.newCreateTargetStateEntryFunc( - sourceRelPath, - fileAttr, - sourceLazyContents, - ) + targetStateEntryFunc = s.newCreateTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents) case SourceFileTypeFile: - targetStateEntryFunc = s.newFileTargetStateEntryFunc( - sourceRelPath, - fileAttr, - sourceLazyContents, - ) + targetStateEntryFunc = s.newFileTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents) case SourceFileTypeModify: // If the target has an extension, determine if it indicates an // interpreter to use. @@ -2059,12 +2005,7 @@ func (s *SourceState) newSourceStateFile( // of the target name, so remove it. targetRelPath = targetRelPath.Slice(0, targetRelPath.Len()-len(extension)-1) } - targetStateEntryFunc = s.newModifyTargetStateEntryFunc( - sourceRelPath, - fileAttr, - sourceLazyContents, - interpreter, - ) + targetStateEntryFunc = s.newModifyTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents, interpreter) case SourceFileTypeRemove: targetStateEntryFunc = s.newRemoveTargetStateEntryFunc(sourceRelPath, fileAttr) case SourceFileTypeScript: @@ -2076,11 +2017,7 @@ func (s *SourceState) newSourceStateFile( sourceRelPath, fileAttr, targetRelPath, sourceLazyContents, interpreter, ) case SourceFileTypeSymlink: - targetStateEntryFunc = s.newSymlinkTargetStateEntryFunc( - sourceRelPath, - fileAttr, - sourceLazyContents, - ) + targetStateEntryFunc = s.newSymlinkTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents) default: panic(fmt.Sprintf("%d: unsupported type", fileAttr.Type)) } @@ -2160,9 +2097,7 @@ func (s *SourceState) newSourceStateFileEntryFromFile( } } lazyContents := newLazyContents(contents) - sourceRelPath := parentSourceRelPath.Join( - NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix())), - ) + sourceRelPath := parentSourceRelPath.Join(NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix()))) return &SourceStateFile{ Attr: fileAttr, origin: actualStateFile, @@ -2179,7 +2114,9 @@ func (s *SourceState) newSourceStateFileEntryFromFile( // newSourceStateFileEntryFromSymlink returns a SourceStateEntry constructed // from a symlink in s. func (s *SourceState) newSourceStateFileEntryFromSymlink( - actualStateSymlink *ActualStateSymlink, fileInfo fs.FileInfo, parentSourceRelPath SourceRelPath, + actualStateSymlink *ActualStateSymlink, + fileInfo fs.FileInfo, + parentSourceRelPath SourceRelPath, options *AddOptions, ) (*SourceStateFile, error) { linkname, err := actualStateSymlink.Linkname() @@ -2210,9 +2147,7 @@ func (s *SourceState) newSourceStateFileEntryFromSymlink( Type: SourceFileTypeSymlink, Template: template, } - sourceRelPath := parentSourceRelPath.Join( - NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix())), - ) + sourceRelPath := parentSourceRelPath.Join(NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix()))) return &SourceStateFile{ Attr: fileAttr, sourceRelPath: sourceRelPath, @@ -2255,13 +2190,7 @@ func (s *SourceState) readExternal( case ExternalTypeArchive: return s.readExternalArchive(ctx, externalRelPath, parentSourceRelPath, external, options) case ExternalTypeArchiveFile: - return s.readExternalArchiveFile( - ctx, - externalRelPath, - parentSourceRelPath, - external, - options, - ) + return s.readExternalArchiveFile(ctx, externalRelPath, parentSourceRelPath, external, options) case ExternalTypeFile: return s.readExternalFile(ctx, externalRelPath, parentSourceRelPath, external, options) case ExternalTypeGitRepo: @@ -2451,12 +2380,8 @@ func (s *SourceState) readExternalArchiveData( url, err := url.Parse(external.URL) if err != nil { - return nil, ArchiveFormatUnknown, fmt.Errorf( - "%s: %s: %w", - externalRelPath, - external.URL, - err, - ) + err := fmt.Errorf("%s: %s: %w", externalRelPath, external.URL, err) + return nil, ArchiveFormatUnknown, err } urlPath := url.Path if external.Encrypted { @@ -2580,7 +2505,9 @@ func (s *SourceState) readExternalArchiveFile( // ReadExternalDir returns all source state entries in an external_ dir. func (s *SourceState) readExternalDir( - rootSourceAbsPath AbsPath, rootSourceRelPath SourceRelPath, rootTargetRelPath RelPath, + rootSourceAbsPath AbsPath, + rootSourceRelPath SourceRelPath, + rootTargetRelPath RelPath, ) (map[RelPath][]SourceStateEntry, error) { sourceStateEntries := make(map[RelPath][]SourceStateEntry) walkFunc := func(absPath AbsPath, fileInfo fs.FileInfo, err error) error { @@ -2662,10 +2589,7 @@ func (s *SourceState) readExternalDir( }, } } - sourceStateEntries[targetRelPath] = append( - sourceStateEntries[targetRelPath], - sourceStateEntry, - ) + sourceStateEntries[targetRelPath] = append(sourceStateEntries[targetRelPath], sourceStateEntry) return nil } if err := Walk(s.system, rootSourceAbsPath, walkFunc); err != nil { @@ -2710,9 +2634,7 @@ func (s *SourceState) readExternalFile( } // readScriptsDir reads all scripts in scriptsDirAbsPath. -func (s *SourceState) readScriptsDir( - ctx context.Context, scriptsDirAbsPath AbsPath, -) (map[RelPath][]SourceStateEntry, error) { +func (s *SourceState) readScriptsDir(ctx context.Context, scriptsDirAbsPath AbsPath) (map[RelPath][]SourceStateEntry, error) { var allSourceStateEntriesMu sync.Mutex allSourceStateEntries := make(map[RelPath][]SourceStateEntry) addSourceStateEntry := func(relPath RelPath, sourceStateEntry SourceStateEntry) { @@ -2773,12 +2695,7 @@ func (s *SourceState) readScriptsDir( return nil } var sourceStateEntry SourceStateEntry - targetRelPath, sourceStateEntry = s.newSourceStateFile( - sourceAbsPath, - sourceRelPath, - fa, - targetRelPath, - ) + targetRelPath, sourceStateEntry = s.newSourceStateFile(sourceAbsPath, sourceRelPath, fa, targetRelPath) addSourceStateEntry(targetRelPath, sourceStateEntry) return nil default: diff --git a/internal/chezmoi/sourcestate_test.go b/internal/chezmoi/sourcestate_test.go index dc4a57ccfcb..7adeb81e59f 100644 --- a/internal/chezmoi/sourcestate_test.go +++ b/internal/chezmoi/sourcestate_test.go @@ -536,15 +536,9 @@ func TestSourceStateAdd(t *testing.T) { destAbsPathInfos := make(map[AbsPath]fs.FileInfo) for _, destAbsPath := range tc.destAbsPaths { - assert.NoError( - t, - s.AddDestAbsPathInfos(destAbsPathInfos, system, destAbsPath, nil), - ) + assert.NoError(t, s.AddDestAbsPathInfos(destAbsPathInfos, system, destAbsPath, nil)) } - assert.NoError( - t, - s.Add(system, persistentState, system, destAbsPathInfos, &tc.addOptions), - ) + assert.NoError(t, s.Add(system, persistentState, system, destAbsPathInfos, &tc.addOptions)) vfst.RunTests(t, fileSystem, "", tc.tests...) }) @@ -556,14 +550,7 @@ func TestSourceStateAddInExternal(t *testing.T) { buffer := &bytes.Buffer{} tarWriterSystem := NewTarWriterSystem(buffer, tar.Header{}) assert.NoError(t, tarWriterSystem.Mkdir(NewAbsPath("dir"), fs.ModePerm)) - assert.NoError( - t, - tarWriterSystem.WriteFile( - NewAbsPath("dir/file"), - []byte("# contents of dir/file\n"), - 0o666, - ), - ) + assert.NoError(t, tarWriterSystem.WriteFile(NewAbsPath("dir/file"), []byte("# contents of dir/file\n"), 0o666)) assert.NoError(t, tarWriterSystem.Close()) archiveData := buffer.Bytes() @@ -1965,23 +1952,21 @@ func (s *SourceState) applyAll( // without error. func requireEvaluateAll(t *testing.T, s *SourceState, destSystem System) { t.Helper() - assert.NoError( - t, - s.root.ForEach( - EmptyRelPath, - func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { - if err := sourceStateEntry.Evaluate(); err != nil { - return err - } - destAbsPath := s.destDirAbsPath.Join(targetRelPath) - targetStateEntry, err := sourceStateEntry.TargetStateEntry(destSystem, destAbsPath) - if err != nil { - return err - } - return targetStateEntry.Evaluate() - }, - ), + err := s.root.ForEach( + EmptyRelPath, + func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { + if err := sourceStateEntry.Evaluate(); err != nil { + return err + } + destAbsPath := s.destDirAbsPath.Join(targetRelPath) + targetStateEntry, err := sourceStateEntry.TargetStateEntry(destSystem, destAbsPath) + if err != nil { + return err + } + return targetStateEntry.Evaluate() + }, ) + assert.NoError(t, err) } func withEntries(sourceEntries map[RelPath]SourceStateEntry) SourceStateOption { diff --git a/internal/chezmoi/sourcestateentry.go b/internal/chezmoi/sourcestateentry.go index 775dc33dec1..b980d3b8363 100644 --- a/internal/chezmoi/sourcestateentry.go +++ b/internal/chezmoi/sourcestateentry.go @@ -116,10 +116,7 @@ func (s *SourceStateCommand) SourceRelPath() SourceRelPath { } // TargetStateEntry returns s's target state entry. -func (s *SourceStateCommand) TargetStateEntry( - destSystem System, - destDirAbsPath AbsPath, -) (TargetStateEntry, error) { +func (s *SourceStateCommand) TargetStateEntry(destSystem System, destDirAbsPath AbsPath) (TargetStateEntry, error) { return &TargetStateModifyDirWithCmd{ cmd: s.cmd, forceRefresh: s.forceRefresh, @@ -156,10 +153,7 @@ func (s *SourceStateDir) SourceRelPath() SourceRelPath { } // TargetStateEntry returns s's target state entry. -func (s *SourceStateDir) TargetStateEntry( - destSystem System, - destDirAbsPath AbsPath, -) (TargetStateEntry, error) { +func (s *SourceStateDir) TargetStateEntry(destSystem System, destDirAbsPath AbsPath) (TargetStateEntry, error) { return s.targetStateEntry, nil } @@ -203,10 +197,7 @@ func (s *SourceStateFile) SourceRelPath() SourceRelPath { } // TargetStateEntry returns s's target state entry. -func (s *SourceStateFile) TargetStateEntry( - destSystem System, - destDirAbsPath AbsPath, -) (TargetStateEntry, error) { +func (s *SourceStateFile) TargetStateEntry(destSystem System, destDirAbsPath AbsPath) (TargetStateEntry, error) { if s.targetStateEntryFunc != nil { s.targetStateEntry, s.targetStateEntryErr = s.targetStateEntryFunc( destSystem, @@ -243,10 +234,7 @@ func (s *SourceStateImplicitDir) SourceRelPath() SourceRelPath { } // TargetStateEntry returns s's target state entry. -func (s *SourceStateImplicitDir) TargetStateEntry( - destSystem System, - destDirAbsPath AbsPath, -) (TargetStateEntry, error) { +func (s *SourceStateImplicitDir) TargetStateEntry(destSystem System, destDirAbsPath AbsPath) (TargetStateEntry, error) { return s.targetStateEntry, nil } @@ -276,10 +264,7 @@ func (s *SourceStateRemove) SourceRelPath() SourceRelPath { } // TargetStateEntry returns s's target state entry. -func (s *SourceStateRemove) TargetStateEntry( - destSystem System, - destDirAbsPath AbsPath, -) (TargetStateEntry, error) { +func (s *SourceStateRemove) TargetStateEntry(destSystem System, destDirAbsPath AbsPath) (TargetStateEntry, error) { return &TargetStateRemove{}, nil } diff --git a/internal/chezmoi/sourcestatetreenode.go b/internal/chezmoi/sourcestatetreenode.go index 57f384e11d7..5daef4e39d6 100644 --- a/internal/chezmoi/sourcestatetreenode.go +++ b/internal/chezmoi/sourcestatetreenode.go @@ -47,10 +47,7 @@ func (n *sourceStateEntryTreeNode) GetNode(targetRelPath RelPath) *sourceStateEn } // ForEach calls f for each SourceStateEntry in the tree. -func (n *sourceStateEntryTreeNode) ForEach( - targetRelPath RelPath, - f func(RelPath, SourceStateEntry) error, -) error { +func (n *sourceStateEntryTreeNode) ForEach(targetRelPath RelPath, f func(RelPath, SourceStateEntry) error) error { return n.ForEachNode( targetRelPath, func(targetRelPath RelPath, node *sourceStateEntryTreeNode) error { @@ -63,9 +60,7 @@ func (n *sourceStateEntryTreeNode) ForEach( } // ForEachNode calls f for each node in the tree. -func (n *sourceStateEntryTreeNode) ForEachNode( - targetRelPath RelPath, f func(RelPath, *sourceStateEntryTreeNode) error, -) error { +func (n *sourceStateEntryTreeNode) ForEachNode(targetRelPath RelPath, f func(RelPath, *sourceStateEntryTreeNode) error) error { switch err := f(targetRelPath, n); { case errors.Is(err, fs.SkipDir): return nil @@ -98,7 +93,9 @@ func (n *sourceStateEntryTreeNode) Map() map[RelPath]SourceStateEntry { // MkdirAll creates SourceStateDirs for all components of targetRelPath if they // do not already exist and returns the SourceStateDir of relPath. func (n *sourceStateEntryTreeNode) MkdirAll( - targetRelPath RelPath, origin SourceStateOrigin, umask fs.FileMode, + targetRelPath RelPath, + origin SourceStateOrigin, + umask fs.FileMode, ) (*SourceStateDir, error) { if targetRelPath == EmptyRelPath { return nil, nil diff --git a/internal/chezmoi/sourcestatetreenode_test.go b/internal/chezmoi/sourcestatetreenode_test.go index 4de7d700c5e..ca0349f8367 100644 --- a/internal/chezmoi/sourcestatetreenode_test.go +++ b/internal/chezmoi/sourcestatetreenode_test.go @@ -21,17 +21,15 @@ func TestSourceStateEntryTreeNodeSingle(t *testing.T) { sourceStateFile := &SourceStateFile{} n.Set(NewRelPath("file"), sourceStateFile) assert.Equal(t, sourceStateFile, n.Get(NewRelPath("file")).(*SourceStateFile)) - assert.NoError( - t, - n.ForEach( - EmptyRelPath, - func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { - assert.Equal(t, NewRelPath("file"), targetRelPath) - assert.Equal(t, sourceStateFile, sourceStateEntry.(*SourceStateFile)) - return nil - }, - ), + err := n.ForEach( + EmptyRelPath, + func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { + assert.Equal(t, NewRelPath("file"), targetRelPath) + assert.Equal(t, sourceStateFile, sourceStateEntry.(*SourceStateFile)) + return nil + }, ) + assert.NoError(t, err) } func TestSourceStateEntryTreeNodeMultiple(t *testing.T) { @@ -49,17 +47,15 @@ func TestSourceStateEntryTreeNodeMultiple(t *testing.T) { } var targetRelPaths []RelPath - assert.NoError( - t, - n.ForEach( - EmptyRelPath, - func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { - assert.Equal(t, entries[targetRelPath], sourceStateEntry) - targetRelPaths = append(targetRelPaths, targetRelPath) - return nil - }, - ), + err := n.ForEach( + EmptyRelPath, + func(targetRelPath RelPath, sourceStateEntry SourceStateEntry) error { + assert.Equal(t, entries[targetRelPath], sourceStateEntry) + targetRelPaths = append(targetRelPaths, targetRelPath) + return nil + }, ) + assert.NoError(t, err) assert.Equal(t, []RelPath{ NewRelPath("a_file"), NewRelPath("b_file"), diff --git a/internal/chezmoi/system.go b/internal/chezmoi/system.go index 7302b3437f4..1baebc09186 100644 --- a/internal/chezmoi/system.go +++ b/internal/chezmoi/system.go @@ -89,12 +89,7 @@ func (noUpdateSystemMixin) RunCmd(cmd *exec.Cmd) error { panic("update to no update system") } -func (noUpdateSystemMixin) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (noUpdateSystemMixin) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { panic("update to no update system") } @@ -241,7 +236,10 @@ func walkSourceDir(system System, name AbsPath, fileInfo fs.FileInfo, walkFunc W } func concurrentWalkSourceDir( - ctx context.Context, system System, dirAbsPath AbsPath, walkFunc concurrentWalkSourceDirFunc, + ctx context.Context, + system System, + dirAbsPath AbsPath, + walkFunc concurrentWalkSourceDirFunc, ) error { dirEntries, err := system.ReadDir(dirAbsPath) if err != nil { diff --git a/internal/chezmoi/system_test.go b/internal/chezmoi/system_test.go index be4418458e3..ec1ed7b76f9 100644 --- a/internal/chezmoi/system_test.go +++ b/internal/chezmoi/system_test.go @@ -78,20 +78,18 @@ func TestWalkSourceDir(t *testing.T) { var actualSourceDirAbsPaths []AbsPath chezmoitest.WithTestFS(t, root, func(fileSystem vfs.FS) { system := NewRealSystem(fileSystem) - assert.NoError( - t, - WalkSourceDir( - system, - sourceDirAbsPath, - func(absPath AbsPath, fileInfo fs.FileInfo, err error) error { - if err != nil { - return err - } - actualSourceDirAbsPaths = append(actualSourceDirAbsPaths, absPath) - return nil - }, - ), + err := WalkSourceDir( + system, + sourceDirAbsPath, + func(absPath AbsPath, fileInfo fs.FileInfo, err error) error { + if err != nil { + return err + } + actualSourceDirAbsPaths = append(actualSourceDirAbsPaths, absPath) + return nil + }, ) + assert.NoError(t, err) }) assert.Equal(t, expectedSourceDirAbsPaths, actualSourceDirAbsPaths) } diff --git a/internal/chezmoi/targetstateentry.go b/internal/chezmoi/targetstateentry.go index 845f6ff32ce..55121c5f9b9 100644 --- a/internal/chezmoi/targetstateentry.go +++ b/internal/chezmoi/targetstateentry.go @@ -80,7 +80,9 @@ type scriptState struct { // Apply updates actualStateEntry to match t. func (t *TargetStateModifyDirWithCmd) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { if _, ok := actualStateEntry.(*ActualStateDir); !ok { if err := actualStateEntry.Remove(system); err != nil { @@ -119,10 +121,7 @@ func (t *TargetStateModifyDirWithCmd) Evaluate() error { } // SkipApply implements TargetStateEntry.SkipApply. -func (t *TargetStateModifyDirWithCmd) SkipApply( - persistentState PersistentState, - targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateModifyDirWithCmd) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { if t.forceRefresh { return false, nil } @@ -151,7 +150,9 @@ func (t *TargetStateModifyDirWithCmd) SourceAttr() SourceAttr { // Apply updates actualStateEntry to match t. It does not recurse. func (t *TargetStateDir) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { if actualStateDir, ok := actualStateEntry.(*ActualStateDir); ok { if runtime.GOOS == "windows" || actualStateDir.perm == t.perm { @@ -179,10 +180,7 @@ func (t *TargetStateDir) Evaluate() error { } // SkipApply implements TargetState.SkipApply. -func (t *TargetStateDir) SkipApply( - persistentState PersistentState, - targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateDir) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { return false, nil } @@ -193,7 +191,9 @@ func (t *TargetStateDir) SourceAttr() SourceAttr { // Apply updates actualStateEntry to match t. func (t *TargetStateFile) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { contents, err := t.Contents() if err != nil { @@ -265,10 +265,7 @@ func (t *TargetStateFile) Perm(umask fs.FileMode) fs.FileMode { } // SkipApply implements TargetStateEntry.SkipApply. -func (t *TargetStateFile) SkipApply( - persistentState PersistentState, - targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateFile) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { return false, nil } @@ -279,7 +276,9 @@ func (t *TargetStateFile) SourceAttr() SourceAttr { // Apply updates actualStateEntry to match t. func (t *TargetStateRemove) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { if _, ok := actualStateEntry.(*ActualStateAbsent); ok { return false, nil @@ -300,10 +299,7 @@ func (t *TargetStateRemove) Evaluate() error { } // SkipApply implements TargetStateEntry.SkipApply. -func (t *TargetStateRemove) SkipApply( - persistentState PersistentState, - targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateRemove) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { return false, nil } @@ -314,7 +310,9 @@ func (t *TargetStateRemove) SourceAttr() SourceAttr { // Apply runs t. func (t *TargetStateScript) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { skipApply, err := t.SkipApply(persistentState, actualStateEntry.Path()) if err != nil { @@ -381,10 +379,7 @@ func (t *TargetStateScript) Evaluate() error { } // SkipApply implements TargetStateEntry.SkipApply. -func (t *TargetStateScript) SkipApply( - persistentState PersistentState, - targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateScript) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { switch contents, err := t.Contents(); { case err != nil: return false, err @@ -435,7 +430,9 @@ func (t *TargetStateScript) SourceAttr() SourceAttr { // Apply updates actualStateEntry to match t. func (t *TargetStateSymlink) Apply( - system System, persistentState PersistentState, actualStateEntry ActualStateEntry, + system System, + persistentState PersistentState, + actualStateEntry ActualStateEntry, ) (bool, error) { linkname, err := t.Linkname() if err != nil { @@ -495,9 +492,7 @@ func (t *TargetStateSymlink) Evaluate() error { } // SkipApply implements TargetStateEntry.SkipApply. -func (t *TargetStateSymlink) SkipApply( - persistentState PersistentState, targetAbsPath AbsPath, -) (bool, error) { +func (t *TargetStateSymlink) SkipApply(persistentState PersistentState, targetAbsPath AbsPath) (bool, error) { return false, nil } diff --git a/internal/chezmoi/targetstateentry_test.go b/internal/chezmoi/targetstateentry_test.go index 13cbd201f01..8b244e29a89 100644 --- a/internal/chezmoi/targetstateentry_test.go +++ b/internal/chezmoi/targetstateentry_test.go @@ -91,12 +91,7 @@ func TestTargetStateEntryApply(t *testing.T) { system := NewRealSystem(fileSystem) // Read the initial destination state entry from fileSystem. - actualStateEntry, err := NewActualStateEntry( - system, - NewAbsPath("/home/user/target"), - nil, - nil, - ) + actualStateEntry, err := NewActualStateEntry(system, NewAbsPath("/home/user/target"), nil, nil) assert.NoError(t, err) // Apply the target state entry. @@ -105,12 +100,8 @@ func TestTargetStateEntryApply(t *testing.T) { // Verify that the actual state entry matches the desired // state. - vfst.RunTests( - t, - fileSystem, - "", - vfst.TestPath("/home/user/target", targetStateTest(t, targetState)...), - ) + tests := vfst.TestPath("/home/user/target", targetStateTest(t, targetState)...) + vfst.RunTests(t, fileSystem, "", tests) }) }, ) diff --git a/internal/chezmoi/tarwritersystem.go b/internal/chezmoi/tarwritersystem.go index d66957783e5..65a5d1f0d5b 100644 --- a/internal/chezmoi/tarwritersystem.go +++ b/internal/chezmoi/tarwritersystem.go @@ -43,12 +43,7 @@ func (s *TarWriterSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *TarWriterSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *TarWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { return s.WriteFile(NewAbsPath(scriptname.String()), data, 0o700) } diff --git a/internal/chezmoi/tarwritersystem_test.go b/internal/chezmoi/tarwritersystem_test.go index d9e58dd3236..cd1235cd936 100644 --- a/internal/chezmoi/tarwritersystem_test.go +++ b/internal/chezmoi/tarwritersystem_test.go @@ -53,12 +53,10 @@ func TestTarWriterSystem(t *testing.T) { b := &bytes.Buffer{} tarWriterSystem := NewTarWriterSystem(b, tar.Header{}) persistentState := NewMockPersistentState() - assert.NoError( - t, - s.applyAll(tarWriterSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ - Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), - }), - ) + err := s.applyAll(tarWriterSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ + Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), + }) + assert.NoError(t, err) assert.NoError(t, tarWriterSystem.Close()) r := tar.NewReader(b) @@ -107,7 +105,7 @@ func TestTarWriterSystem(t *testing.T) { } }) } - _, err := r.Next() + _, err = r.Next() assert.Equal(t, io.EOF, err) }) } diff --git a/internal/chezmoi/template.go b/internal/chezmoi/template.go index 04f24f033ec..4006c2d214e 100644 --- a/internal/chezmoi/template.go +++ b/internal/chezmoi/template.go @@ -25,12 +25,7 @@ type TemplateOptions struct { // ParseTemplate parses a template named name from data with the given funcs and // templateOptions. -func ParseTemplate( - name string, - data []byte, - funcs template.FuncMap, - options TemplateOptions, -) (*Template, error) { +func ParseTemplate(name string, data []byte, funcs template.FuncMap, options TemplateOptions) (*Template, error) { contents := options.parseAndRemoveDirectives(data) template, err := template.New(name). Option(options.Options...). @@ -83,10 +78,7 @@ func (o *TemplateOptions) parseAndRemoveDirectives(data []byte) []byte { // Parse options from directives. for _, directiveMatch := range directiveMatches { - keyValuePairMatches := templateDirectiveKeyValuePairRx.FindAllSubmatch( - data[directiveMatch[2]:directiveMatch[3]], - -1, - ) + keyValuePairMatches := templateDirectiveKeyValuePairRx.FindAllSubmatch(data[directiveMatch[2]:directiveMatch[3]], -1) for _, keyValuePairMatch := range keyValuePairMatches { key := string(keyValuePairMatch[1]) value := maybeUnquote(string(keyValuePairMatch[2])) diff --git a/internal/chezmoi/zipwritersystem.go b/internal/chezmoi/zipwritersystem.go index c438413c138..609952781ad 100644 --- a/internal/chezmoi/zipwritersystem.go +++ b/internal/chezmoi/zipwritersystem.go @@ -48,12 +48,7 @@ func (s *ZIPWriterSystem) RunCmd(cmd *exec.Cmd) error { } // RunScript implements System.RunScript. -func (s *ZIPWriterSystem) RunScript( - scriptname RelPath, - dir AbsPath, - data []byte, - options RunScriptOptions, -) error { +func (s *ZIPWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, options RunScriptOptions) error { return s.WriteFile(NewAbsPath(scriptname.String()), data, 0o700) } diff --git a/internal/chezmoi/zipwritersystem_test.go b/internal/chezmoi/zipwritersystem_test.go index c5abe380b1b..9664e942650 100644 --- a/internal/chezmoi/zipwritersystem_test.go +++ b/internal/chezmoi/zipwritersystem_test.go @@ -54,12 +54,10 @@ func TestZIPWriterSystem(t *testing.T) { b := &bytes.Buffer{} zipWriterSystem := NewZIPWriterSystem(b, time.Now().UTC()) persistentState := NewMockPersistentState() - assert.NoError( - t, - s.applyAll(zipWriterSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ - Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), - }), - ) + err := s.applyAll(zipWriterSystem, system, persistentState, EmptyAbsPath, ApplyOptions{ + Filter: NewEntryTypeFilter(EntryTypesAll, EntryTypesNone), + }) + assert.NoError(t, err) assert.NoError(t, zipWriterSystem.Close()) r, err := zip.NewReader(bytes.NewReader(b.Bytes()), int64(b.Len())) diff --git a/internal/chezmoibubbles/boolinputmodel_test.go b/internal/chezmoibubbles/boolinputmodel_test.go index 2098f94752f..33051fa2582 100644 --- a/internal/chezmoibubbles/boolinputmodel_test.go +++ b/internal/chezmoibubbles/boolinputmodel_test.go @@ -62,11 +62,7 @@ func TestBoolInputModel(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - actualModel := testRunModelWithInput( - t, - NewBoolInputModel("prompt", tc.defaultValue), - tc.input, - ) + actualModel := testRunModelWithInput(t, NewBoolInputModel("prompt", tc.defaultValue), tc.input) assert.Equal(t, tc.expectedCanceled, actualModel.Canceled()) assert.Equal(t, tc.expectedValue, actualModel.Value()) }) diff --git a/internal/chezmoibubbles/choiceinputmodel_test.go b/internal/chezmoibubbles/choiceinputmodel_test.go index 4ffadeaa441..6fcd658073a 100644 --- a/internal/chezmoibubbles/choiceinputmodel_test.go +++ b/internal/chezmoibubbles/choiceinputmodel_test.go @@ -70,11 +70,7 @@ func TestChoiceInputModel(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - actualModel := testRunModelWithInput( - t, - NewChoiceInputModel("prompt", tc.choices, tc.defaultValue), - tc.input, - ) + actualModel := testRunModelWithInput(t, NewChoiceInputModel("prompt", tc.choices, tc.defaultValue), tc.input) assert.Equal(t, tc.expectedCanceled, actualModel.Canceled()) assert.Equal(t, tc.expectedValue, actualModel.Value()) }) diff --git a/internal/chezmoibubbles/intinputmodel_test.go b/internal/chezmoibubbles/intinputmodel_test.go index fd6c3f418f2..285573e3a85 100644 --- a/internal/chezmoibubbles/intinputmodel_test.go +++ b/internal/chezmoibubbles/intinputmodel_test.go @@ -52,11 +52,7 @@ func TestIntInputModel(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - actualModel := testRunModelWithInput( - t, - NewIntInputModel("prompt", tc.defaultValue), - tc.input, - ) + actualModel := testRunModelWithInput(t, NewIntInputModel("prompt", tc.defaultValue), tc.input) assert.Equal(t, tc.expectedCanceled, actualModel.Canceled()) assert.Equal(t, tc.expectedValue, actualModel.Value()) }) diff --git a/internal/chezmoibubbles/stringinputmodel_test.go b/internal/chezmoibubbles/stringinputmodel_test.go index 590a3de3e4a..fce1f15874f 100644 --- a/internal/chezmoibubbles/stringinputmodel_test.go +++ b/internal/chezmoibubbles/stringinputmodel_test.go @@ -47,11 +47,7 @@ func TestStringInputModel(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - actualModel := testRunModelWithInput( - t, - NewStringInputModel("prompt", tc.defaultValue), - tc.input, - ) + actualModel := testRunModelWithInput(t, NewStringInputModel("prompt", tc.defaultValue), tc.input) assert.Equal(t, tc.expectedCanceled, actualModel.Canceled()) assert.Equal(t, tc.expectedValue, actualModel.Value()) }) diff --git a/internal/chezmoilog/chezmoilog.go b/internal/chezmoilog/chezmoilog.go index b8459ce55e8..9e93e904f3d 100644 --- a/internal/chezmoilog/chezmoilog.go +++ b/internal/chezmoilog/chezmoilog.go @@ -101,11 +101,7 @@ func FirstFewBytes(data []byte) []byte { // LogHTTPRequest calls httpClient.Do, logs the result to logger, and returns // the result. -func LogHTTPRequest( - logger *zerolog.Logger, - client *http.Client, - req *http.Request, -) (*http.Response, error) { +func LogHTTPRequest(logger *zerolog.Logger, client *http.Client, req *http.Request) (*http.Response, error) { start := time.Now() resp, err := client.Do(req) if resp != nil { diff --git a/internal/cmd/addcmd.go b/internal/cmd/addcmd.go index 5245a62967c..fb55cbf4217 100644 --- a/internal/cmd/addcmd.go +++ b/internal/cmd/addcmd.go @@ -148,11 +148,7 @@ func (c *Config) defaultReplaceFunc( return nil } removedAttributesStr := englishListWithNoun(removedAttributes, "attribute", "") - prompt := fmt.Sprintf( - "adding %s would remove %s, continue", - targetRelPath, - removedAttributesStr, - ) + prompt := fmt.Sprintf("adding %s would remove %s, continue", targetRelPath, removedAttributesStr) for { switch choice, err := c.promptChoice(prompt, choicesYesNoAllQuit); { @@ -173,11 +169,7 @@ func (c *Config) defaultReplaceFunc( } } -func (c *Config) runAddCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runAddCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { destAbsPathInfos, err := c.destAbsPathInfos(sourceState, args, destAbsPathInfosOptions{ follow: c.Mode == chezmoi.ModeSymlink || c.Add.follow, recursive: c.Add.recursive, diff --git a/internal/cmd/addcmd_test.go b/internal/cmd/addcmd_test.go index df7e8b467d3..ab05412aa1e 100644 --- a/internal/cmd/addcmd_test.go +++ b/internal/cmd/addcmd_test.go @@ -241,10 +241,7 @@ func TestAddCmd(t *testing.T) { t.Run(tc.name, func(t *testing.T) { chezmoitest.SkipUnlessGOOS(t, tc.name) chezmoitest.WithTestFS(t, tc.root, func(fileSystem vfs.FS) { - assert.NoError( - t, - newTestConfig(t, fileSystem).execute(append([]string{"add"}, tc.args...)), - ) + assert.NoError(t, newTestConfig(t, fileSystem).execute(append([]string{"add"}, tc.args...))) vfst.RunTests(t, fileSystem, "", tc.tests...) }) }) @@ -263,9 +260,6 @@ func TestAddCmdChmod(t *testing.T) { }, func(fileSystem vfs.FS) { assert.NoError(t, newTestConfig(t, fileSystem).execute([]string{"add", "/home/user/.dir"})) assert.NoError(t, fileSystem.Chmod("/home/user/.dir/subdir", 0o700)) - assert.NoError( - t, - newTestConfig(t, fileSystem).execute([]string{"add", "--force", "/home/user/.dir"}), - ) + assert.NoError(t, newTestConfig(t, fileSystem).execute([]string{"add", "--force", "/home/user/.dir"})) }) } diff --git a/internal/cmd/applycmd_test.go b/internal/cmd/applycmd_test.go index 08a8b211852..b43c3933feb 100644 --- a/internal/cmd/applycmd_test.go +++ b/internal/cmd/applycmd_test.go @@ -205,10 +205,7 @@ func TestApplyCmd(t *testing.T) { if tc.extraRoot != nil { assert.NoError(t, vfst.NewBuilder().Build(fileSystem, tc.extraRoot)) } - assert.NoError( - t, - newTestConfig(t, fileSystem).execute(append([]string{"apply"}, tc.args...)), - ) + assert.NoError(t, newTestConfig(t, fileSystem).execute(append([]string{"apply"}, tc.args...))) vfst.RunTests(t, fileSystem, "", tc.tests) }) }) diff --git a/internal/cmd/awssecretsmanagertemplatefuncs.go b/internal/cmd/awssecretsmanagertemplatefuncs.go index 082f06f4361..871026574e3 100644 --- a/internal/cmd/awssecretsmanagertemplatefuncs.go +++ b/internal/cmd/awssecretsmanagertemplatefuncs.go @@ -42,12 +42,9 @@ func (c *Config) awsSecretsManagerRawTemplateFunc(arn string) string { c.AWSSecretsManager.svc = secretsmanager.NewFromConfig(cfg) } - result, err := c.AWSSecretsManager.svc.GetSecretValue( - context.Background(), - &secretsmanager.GetSecretValueInput{ - SecretId: aws.String(arn), - }, - ) + result, err := c.AWSSecretsManager.svc.GetSecretValue(context.Background(), &secretsmanager.GetSecretValueInput{ + SecretId: aws.String(arn), + }) if err != nil { panic(err) } diff --git a/internal/cmd/catcmd.go b/internal/cmd/catcmd.go index d5b0c45e6d1..0d93a2c24b3 100644 --- a/internal/cmd/catcmd.go +++ b/internal/cmd/catcmd.go @@ -26,11 +26,7 @@ func (c *Config) newCatCmd() *cobra.Command { return catCmd } -func (c *Config) runCatCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runCatCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeManaged: true, }) @@ -41,10 +37,7 @@ func (c *Config) runCatCmd( builder := strings.Builder{} for _, targetRelPath := range targetRelPaths { sourceStateEntry := sourceState.MustEntry(targetRelPath) - targetStateEntry, err := sourceStateEntry.TargetStateEntry( - c.destSystem, - c.DestDirAbsPath.Join(targetRelPath), - ) + targetStateEntry, err := sourceStateEntry.TargetStateEntry(c.destSystem, c.DestDirAbsPath.Join(targetRelPath)) if err != nil { return fmt.Errorf("%s: %w", targetRelPath, err) } diff --git a/internal/cmd/chattrcmd.go b/internal/cmd/chattrcmd.go index f22986ff45d..3f7d2918ebd 100644 --- a/internal/cmd/chattrcmd.go +++ b/internal/cmd/chattrcmd.go @@ -101,9 +101,7 @@ func (c *Config) newChattrCmd() *cobra.Command { } // chattrCmdValidArgs returns the completions for the chattr command. -func (c *Config) chattrCmdValidArgs( - cmd *cobra.Command, args []string, toComplete string, -) ([]string, cobra.ShellCompDirective) { +func (c *Config) chattrCmdValidArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { switch len(args) { case 0: prefixes := []string{"", "-", "+", "no"} @@ -151,11 +149,7 @@ func (c *Config) chattrCmdValidArgs( } } -func (c *Config) runChattrCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runChattrCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { // LATER should the core functionality of chattr move to chezmoi.SourceState? m, err := parseModifier(args[0]) @@ -301,9 +295,7 @@ func (m orderModifier) modify(order chezmoi.ScriptOrder) chezmoi.ScriptOrder { } // modify returns the modified value of type. -func (m sourceFileTypeModifier) modify( - sourceFileType chezmoi.SourceFileTargetType, -) chezmoi.SourceFileTargetType { +func (m sourceFileTypeModifier) modify(sourceFileType chezmoi.SourceFileTargetType) chezmoi.SourceFileTargetType { switch m { case sourceFileTypeModifierLeaveUnchanged: return sourceFileType diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 5d1ef615d4f..a32091c470e 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -155,9 +155,7 @@ func example(command string) string { } // extractHelps returns the helps parse from r. -func extractHelp( - command string, data []byte, longHelpTermRenderer, exampleTermRenderer *glamour.TermRenderer, -) (*help, error) { +func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermRenderer *glamour.TermRenderer) (*help, error) { type stateType int const ( stateReadTitle stateType = iota diff --git a/internal/cmd/config.go b/internal/cmd/config.go index fc546c9aaf1..9c2c218e5bf 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -734,11 +734,7 @@ func (c *Config) createAndReloadConfigFile(cmd *cobra.Command) error { return c.persistentState.Delete(chezmoi.ConfigStateBucket, configStateKey) } - configFileContents, err := c.createConfigFile( - configTemplate.targetRelPath, - configTemplate.contents, - cmd, - ) + configFileContents, err := c.createConfigFile(configTemplate.targetRelPath, configTemplate.contents, cmd) if err != nil { return err } @@ -790,11 +786,7 @@ func (c *Config) createAndReloadConfigFile(cmd *cobra.Command) error { // createConfigFile creates a config file using a template and returns its // contents. -func (c *Config) createConfigFile( - filename chezmoi.RelPath, - data []byte, - cmd *cobra.Command, -) ([]byte, error) { +func (c *Config) createConfigFile(filename chezmoi.RelPath, data []byte, cmd *cobra.Command) ([]byte, error) { funcMap := make(template.FuncMap) chezmoi.RecursiveMerge(funcMap, c.templateFuncs) initTemplateFuncs := map[string]any{ @@ -828,10 +820,7 @@ func (c *Config) createConfigFile( // defaultConfigFile returns the default config file according to the XDG Base // Directory Specification. -func (c *Config) defaultConfigFile( - fileSystem vfs.FS, - bds *xdg.BaseDirectorySpecification, -) (chezmoi.AbsPath, error) { +func (c *Config) defaultConfigFile(fileSystem vfs.FS, bds *xdg.BaseDirectorySpecification) (chezmoi.AbsPath, error) { // Search XDG Base Directory Specification config directories first. CONFIG_DIR: for _, configDir := range bds.ConfigDirs { @@ -885,11 +874,7 @@ CONFIG_DIR: } // decodeConfigBytes decodes data in format into configFile. -func (c *Config) decodeConfigBytes( - format chezmoi.Format, - data []byte, - configFile *ConfigFile, -) error { +func (c *Config) decodeConfigBytes(format chezmoi.Format, data []byte, configFile *ConfigFile) error { var configMap map[string]any if err := format.Unmarshal(data, &configMap); err != nil { return err @@ -984,11 +969,8 @@ func (c *Config) defaultPreApplyFunc( case err != nil: return err case choice == "diff": - if err := c.diffFile( - targetRelPath, - actualContents, actualEntryState.Mode, - targetContents, targetEntryState.Mode, - ); err != nil { + err := c.diffFile(targetRelPath, actualContents, actualEntryState.Mode, targetContents, targetEntryState.Mode) + if err != nil { return err } case choice == "yes": @@ -1054,10 +1036,7 @@ func (c *Config) defaultPreApplyFunc( // defaultSourceDir returns the default source directory according to the XDG // Base Directory Specification. -func (c *Config) defaultSourceDir( - fileSystem vfs.Stater, - bds *xdg.BaseDirectorySpecification, -) (chezmoi.AbsPath, error) { +func (c *Config) defaultSourceDir(fileSystem vfs.Stater, bds *xdg.BaseDirectorySpecification) (chezmoi.AbsPath, error) { // Check for XDG Base Directory Specification data directories first. for _, dataDir := range bds.DataDirs { dataDirAbsPath, err := chezmoi.NewAbsPathFromExtPath(dataDir, c.homeDirAbsPath) @@ -1087,7 +1066,9 @@ type destAbsPathInfosOptions struct { // args, recursing into subdirectories and following symlinks if configured in // options. func (c *Config) destAbsPathInfos( - sourceState *chezmoi.SourceState, args []string, options destAbsPathInfosOptions, + sourceState *chezmoi.SourceState, + args []string, + options destAbsPathInfosOptions, ) (map[chezmoi.AbsPath]fs.FileInfo, error) { destAbsPathInfos := make(map[chezmoi.AbsPath]fs.FileInfo) for _, arg := range args { @@ -1113,12 +1094,7 @@ func (c *Config) destAbsPathInfos( return err } } - return sourceState.AddDestAbsPathInfos( - destAbsPathInfos, - c.destSystem, - destAbsPath, - fileInfo, - ) + return sourceState.AddDestAbsPathInfos(destAbsPathInfos, c.destSystem, destAbsPath, fileInfo) } if err := chezmoi.Walk(c.destSystem, destAbsPath, walkFunc); err != nil { return nil, err @@ -1148,8 +1124,10 @@ func (c *Config) destAbsPathInfos( // at path. func (c *Config) diffFile( path chezmoi.RelPath, - fromData []byte, fromMode fs.FileMode, - toData []byte, toMode fs.FileMode, + fromData []byte, + fromMode fs.FileMode, + toData []byte, + toMode fs.FileMode, ) error { builder := strings.Builder{} unifiedEncoder := diff.NewUnifiedEncoder(&builder, diff.DefaultContextLines) @@ -1399,10 +1377,7 @@ func (c *Config) getSourceDirAbsPath(options *getSourceDirAbsPathOptions) (chezm return c.sourceDirAbsPath, c.sourceDirAbsPathErr } -func (c *Config) getSourceState( - ctx context.Context, - cmd *cobra.Command, -) (*chezmoi.SourceState, error) { +func (c *Config) getSourceState(ctx context.Context, cmd *cobra.Command) (*chezmoi.SourceState, error) { if c.sourceState != nil || c.sourceStateErr != nil { return c.sourceState, c.sourceStateErr } @@ -1708,11 +1683,7 @@ func (c *Config) newRootCmd() (*cobra.Command, error) { // newDiffSystem returns a system that logs all changes to s to w using // diff.command if set or the builtin git diff otherwise. -func (c *Config) newDiffSystem( - s chezmoi.System, - w io.Writer, - dirAbsPath chezmoi.AbsPath, -) chezmoi.System { +func (c *Config) newDiffSystem(s chezmoi.System, w io.Writer, dirAbsPath chezmoi.AbsPath) chezmoi.System { if c.Diff.useBuiltinDiff || c.Diff.Command == "" { options := &chezmoi.GitDiffSystemOptions{ Color: c.Color.Value(c.colorAutoFunc), @@ -1736,7 +1707,9 @@ func (c *Config) newDiffSystem( // newSourceState returns a new SourceState with options. func (c *Config) newSourceState( - ctx context.Context, cmd *cobra.Command, options ...chezmoi.SourceStateOption, + ctx context.Context, + cmd *cobra.Command, + options ...chezmoi.SourceStateOption, ) (*chezmoi.SourceState, error) { if err := c.checkVersion(); err != nil { return nil, err @@ -2410,11 +2383,7 @@ func (c *Config) runEditor(args []string) error { err = c.run(chezmoi.EmptyAbsPath, editor, editorArgs) if runtime.GOOS != "windows" && c.Edit.MinDuration != 0 { if duration := time.Since(start); duration < c.Edit.MinDuration { - c.errorf( - "warning: %s: returned in less than %s\n", - shellQuoteCommand(editor, editorArgs), - c.Edit.MinDuration, - ) + c.errorf("warning: %s: returned in less than %s\n", shellQuoteCommand(editor, editorArgs), c.Edit.MinDuration) } } return err @@ -2500,10 +2469,7 @@ func (c *Config) setEnvironmentVariables() error { // sourceAbsPaths returns the source absolute paths for each target path in // args. -func (c *Config) sourceAbsPaths( - sourceState *chezmoi.SourceState, - args []string, -) ([]chezmoi.AbsPath, error) { +func (c *Config) sourceAbsPaths(sourceState *chezmoi.SourceState, args []string) ([]chezmoi.AbsPath, error) { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeInSourceState: true, mustBeManaged: true, @@ -2542,7 +2508,9 @@ type targetRelPathsOptions struct { // targetRelPaths returns the target relative paths for each target path in // args. The returned paths are sorted and de-duplicated. func (c *Config) targetRelPaths( - sourceState *chezmoi.SourceState, args []string, options targetRelPathsOptions, + sourceState *chezmoi.SourceState, + args []string, + options targetRelPathsOptions, ) (chezmoi.RelPaths, error) { targetRelPaths := make(chezmoi.RelPaths, 0, len(args)) for _, arg := range args { @@ -2594,9 +2562,7 @@ func (c *Config) targetRelPaths( // targetRelPathsBySourcePath returns the target relative paths for each arg in // args. -func (c *Config) targetRelPathsBySourcePath( - sourceState *chezmoi.SourceState, args []string, -) ([]chezmoi.RelPath, error) { +func (c *Config) targetRelPathsBySourcePath(sourceState *chezmoi.SourceState, args []string) ([]chezmoi.RelPath, error) { targetRelPaths := make([]chezmoi.RelPath, 0, len(args)) targetRelPathsBySourceRelPath := make(map[chezmoi.RelPath]chezmoi.RelPath) _ = sourceState.ForEach( @@ -2625,9 +2591,7 @@ func (c *Config) targetRelPathsBySourcePath( } // targetValidArgs returns target completions for toComplete given args. -func (c *Config) targetValidArgs( - cmd *cobra.Command, args []string, toComplete string, -) ([]string, cobra.ShellCompDirective) { +func (c *Config) targetValidArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { if !c.Completion.Custom { return nil, cobra.ShellCompDirectiveDefault } diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index faec73cc5b4..fc2fb262644 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -433,13 +433,7 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { // output of chezmoi doctor is often posted publicly and would otherwise // reveal the user's username. message = strings.ReplaceAll(message, homeDirAbsPath.String(), "~") - fmt.Fprintf( - resultWriter, - "%s\t%s\t%s\n", - checkResultStr[checkResult], - check.Name(), - message, - ) + fmt.Fprintf(resultWriter, "%s\t%s\t%s\n", checkResultStr[checkResult], check.Name(), message) if checkResult > worstResult { worstResult = checkResult } @@ -457,10 +451,7 @@ func (c *argsCheck) Name() string { return c.name } -func (c *argsCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *argsCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { return checkResultOK, shellQuoteCommand(c.command, c.args) } @@ -468,10 +459,7 @@ func (c *binaryCheck) Name() string { return c.name } -func (c *binaryCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *binaryCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { if c.binaryname == "" { return c.ifNotSet, "not set" } @@ -533,10 +521,7 @@ func (c *configFileCheck) Name() string { return "config-file" } -func (c *configFileCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *configFileCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { filenameAbsPaths := make(map[chezmoi.AbsPath]struct{}) for _, dir := range append([]string{c.bds.ConfigHome}, c.bds.ConfigDirs...) { configDirAbsPath, err := chezmoi.NewAbsPathFromExtPath(dir, homeDirAbsPath) @@ -544,10 +529,7 @@ func (c *configFileCheck) Run( return checkResultFailed, err.Error() } for _, extension := range chezmoi.FormatExtensions { - filenameAbsPath := configDirAbsPath.Join( - c.basename, - chezmoi.NewRelPath(c.basename.String()+"."+extension), - ) + filenameAbsPath := configDirAbsPath.Join(c.basename, chezmoi.NewRelPath(c.basename.String()+"."+extension)) if _, err := system.Stat(filenameAbsPath); err == nil { filenameAbsPaths[filenameAbsPath] = struct{}{} } @@ -559,11 +541,7 @@ func (c *configFileCheck) Run( case 1: filenameAbsPath := anyKey(filenameAbsPaths) if filenameAbsPath != c.expected { - return checkResultFailed, fmt.Sprintf( - "found %s, expected %s", - filenameAbsPath, - c.expected, - ) + return checkResultFailed, fmt.Sprintf("found %s, expected %s", filenameAbsPath, c.expected) } config, err := newConfig() if err != nil { @@ -599,10 +577,7 @@ func (c *dirCheck) Name() string { return c.name } -func (c *dirCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *dirCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { dirEntries, err := system.ReadDir(c.dirname) if err != nil { return checkResultError, err.Error() @@ -653,10 +628,7 @@ func (executableCheck) Name() string { return "executable" } -func (executableCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (executableCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { executable, err := os.Executable() if err != nil { return checkResultError, err.Error() @@ -672,10 +644,7 @@ func (c *fileCheck) Name() string { return c.name } -func (c *fileCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *fileCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { if c.filename.Empty() { return c.ifNotSet, "not set" } @@ -694,10 +663,7 @@ func (goVersionCheck) Name() string { return "go-version" } -func (goVersionCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (goVersionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { return checkResultOK, fmt.Sprintf("%s (%s)", runtime.Version(), runtime.Compiler) } @@ -705,10 +671,7 @@ func (c *latestVersionCheck) Name() string { return "latest-version" } -func (c *latestVersionCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *latestVersionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { if c.httpClientErr != nil { return checkResultFailed, c.httpClientErr.Error() } @@ -746,10 +709,7 @@ func (osArchCheck) Name() string { return "os-arch" } -func (osArchCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (osArchCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { fields := []string{runtime.GOOS + "/" + runtime.GOARCH} if osRelease, err := chezmoi.OSRelease(system.UnderlyingFS()); err == nil { if name, ok := osRelease["NAME"].(string); ok { @@ -767,10 +727,7 @@ func (skippedCheck) Name() string { return "skipped" } -func (skippedCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (skippedCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { return checkResultSkipped, "" } @@ -778,10 +735,7 @@ func (c *suspiciousEntriesCheck) Name() string { return "suspicious-entries" } -func (c *suspiciousEntriesCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *suspiciousEntriesCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { // FIXME include user-defined suffixes from age and gpg configs encryptedSuffixes := []string{ defaultAgeEncryptionConfig.Suffix, @@ -814,10 +768,7 @@ func (upgradeMethodCheck) Name() string { return "upgrade-method" } -func (upgradeMethodCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (upgradeMethodCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { executable, err := os.Executable() if err != nil { return checkResultFailed, err.Error() @@ -836,10 +787,7 @@ func (c *versionCheck) Name() string { return "version" } -func (c *versionCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (c *versionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { if c.versionInfo.Version == "" || c.versionInfo.Commit == "" { return checkResultWarning, c.versionStr } diff --git a/internal/cmd/doctorcmd_windows.go b/internal/cmd/doctorcmd_windows.go index 2e52447db5d..e6df5a47577 100644 --- a/internal/cmd/doctorcmd_windows.go +++ b/internal/cmd/doctorcmd_windows.go @@ -21,10 +21,7 @@ func (systeminfoCheck) Name() string { return "systeminfo" } -func (systeminfoCheck) Run( - system chezmoi.System, - homeDirAbsPath chezmoi.AbsPath, -) (checkResult, string) { +func (systeminfoCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { cmd := exec.Command("systeminfo") data, err := chezmoilog.LogCmdOutput(cmd) if err != nil { diff --git a/internal/cmd/dopplertemplatefuncs.go b/internal/cmd/dopplertemplatefuncs.go index d1e3ad31e6a..ba63d31ed9c 100644 --- a/internal/cmd/dopplertemplatefuncs.go +++ b/internal/cmd/dopplertemplatefuncs.go @@ -69,9 +69,7 @@ func (c *Config) dopplerProjectJSONTemplateFunc(additionalArgs ...string) any { return value } -func (c *Config) appendDopplerAdditionalArgs( - args, additionalArgs []string, -) []string { +func (c *Config) appendDopplerAdditionalArgs(args, additionalArgs []string) []string { if len(additionalArgs) > 0 && additionalArgs[0] != "" { args = append(args, "--project", additionalArgs[0]) } else if c.Doppler.Project != "" { diff --git a/internal/cmd/editconfigtemplatecmd.go b/internal/cmd/editconfigtemplatecmd.go index 3989cf02df2..7abfd8439b3 100644 --- a/internal/cmd/editconfigtemplatecmd.go +++ b/internal/cmd/editconfigtemplatecmd.go @@ -27,11 +27,7 @@ func (c *Config) newEditConfigTemplateCmd() *cobra.Command { return editConfigCmd } -func (c *Config) runEditConfigTemplateCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runEditConfigTemplateCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { var configTemplateAbsPath chezmoi.AbsPath switch configTemplate, err := c.findConfigTemplate(); { case err != nil: diff --git a/internal/cmd/errors.go b/internal/cmd/errors.go index ac957bb0375..8268e4931e4 100644 --- a/internal/cmd/errors.go +++ b/internal/cmd/errors.go @@ -39,12 +39,7 @@ type parseCmdOutputError struct { err error } -func newParseCmdOutputError( - command string, - args []string, - output []byte, - err error, -) *parseCmdOutputError { +func newParseCmdOutputError(command string, args []string, output []byte, err error) *parseCmdOutputError { return &parseCmdOutputError{ command: command, args: args, diff --git a/internal/cmd/forgetcmd.go b/internal/cmd/forgetcmd.go index abbb7ebf20e..62d1e737185 100644 --- a/internal/cmd/forgetcmd.go +++ b/internal/cmd/forgetcmd.go @@ -27,11 +27,7 @@ func (c *Config) newForgetCmd() *cobra.Command { return forgetCmd } -func (c *Config) runForgetCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runForgetCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeManaged: true, }) diff --git a/internal/cmd/hcpvaultsecretsttemplatefuncs.go b/internal/cmd/hcpvaultsecretsttemplatefuncs.go index 3a0318feb46..5dc1005c47d 100644 --- a/internal/cmd/hcpvaultsecretsttemplatefuncs.go +++ b/internal/cmd/hcpvaultsecretsttemplatefuncs.go @@ -58,9 +58,7 @@ func (c *Config) hcpVaultSecretJSONTemplateFunc(key string, additionalArgs ...st return value } -func (c *Config) appendHCPVaultSecretsAdditionalArgs( - args, additionalArgs []string, -) ([]string, error) { +func (c *Config) appendHCPVaultSecretsAdditionalArgs(args, additionalArgs []string) ([]string, error) { if len(additionalArgs) > 0 && additionalArgs[0] != "" { args = append(args, "--app-name", additionalArgs[0]) } else if c.HCPVaultSecrets.ApplicationName != "" { diff --git a/internal/cmd/ignoredcmd.go b/internal/cmd/ignoredcmd.go index d4c63cabb99..b46f5c18dae 100644 --- a/internal/cmd/ignoredcmd.go +++ b/internal/cmd/ignoredcmd.go @@ -22,11 +22,7 @@ func (c *Config) newIgnoredCmd() *cobra.Command { return ignoredCmd } -func (c *Config) runIgnoredCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runIgnoredCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { builder := strings.Builder{} for _, relPath := range sourceState.Ignored() { if _, err := builder.WriteString(relPath.String()); err != nil { diff --git a/internal/cmd/importcmd.go b/internal/cmd/importcmd.go index ac4ad125881..32218c65ce6 100644 --- a/internal/cmd/importcmd.go +++ b/internal/cmd/importcmd.go @@ -60,11 +60,7 @@ func (c *Config) newImportCmd() *cobra.Command { return importCmd } -func (c *Config) runImportCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runImportCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { var ( name string data []byte diff --git a/internal/cmd/initcmd.go b/internal/cmd/initcmd.go index 8ea1e0b2fa8..0ff976a8595 100644 --- a/internal/cmd/initcmd.go +++ b/internal/cmd/initcmd.go @@ -206,10 +206,7 @@ func (c *Config) runInitCmd(cmd *cobra.Command, args []string) error { "--depth", strconv.Itoa(c.init.depth), ) } - args = append(args, - repoURLStr, - workingTreeRawPath.String(), - ) + args = append(args, repoURLStr, workingTreeRawPath.String()) if err := c.run(chezmoi.EmptyAbsPath, c.Git.Command, args); err != nil { return err } diff --git a/internal/cmd/interactivetemplatefuncs.go b/internal/cmd/interactivetemplatefuncs.go index a9d73896df7..847a399ef9c 100644 --- a/internal/cmd/interactivetemplatefuncs.go +++ b/internal/cmd/interactivetemplatefuncs.go @@ -77,12 +77,7 @@ func (c *Config) promptBoolInteractiveTemplateFunc(prompt string, args ...bool) return value } -func (c *Config) promptBoolOnceInteractiveTemplateFunc( - m map[string]any, - path any, - prompt string, - args ...bool, -) bool { +func (c *Config) promptBoolOnceInteractiveTemplateFunc(m map[string]any, path any, prompt string, args ...bool) bool { if len(args) > 1 { err := fmt.Errorf("want 3 or 4 arguments, got %d", len(args)+2) panic(err) @@ -108,11 +103,7 @@ func (c *Config) promptBoolOnceInteractiveTemplateFunc( return c.promptBoolInteractiveTemplateFunc(prompt, args...) } -func (c *Config) promptChoiceInteractiveTemplateFunc( - prompt string, - choices []any, - args ...string, -) string { +func (c *Config) promptChoiceInteractiveTemplateFunc(prompt string, choices []any, args ...string) string { if len(args) > 1 { err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) panic(err) @@ -178,12 +169,7 @@ func (c *Config) promptIntInteractiveTemplateFunc(prompt string, args ...int64) return value } -func (c *Config) promptIntOnceInteractiveTemplateFunc( - m map[string]any, - path any, - prompt string, - args ...int64, -) int64 { +func (c *Config) promptIntOnceInteractiveTemplateFunc(m map[string]any, path any, prompt string, args ...int64) int64 { if len(args) > 1 { err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) panic(err) @@ -221,12 +207,7 @@ func (c *Config) promptStringInteractiveTemplateFunc(prompt string, args ...stri return value } -func (c *Config) promptStringOnceInteractiveTemplateFunc( - m map[string]any, - path any, - prompt string, - args ...string, -) string { +func (c *Config) promptStringOnceInteractiveTemplateFunc(m map[string]any, path any, prompt string, args ...string) string { if len(args) > 1 { err := fmt.Errorf("want 2 or 3 arguments, got %d", len(args)+2) panic(err) diff --git a/internal/cmd/keepassxctemplatefuncs.go b/internal/cmd/keepassxctemplatefuncs.go index b24bf2222d4..98d168dbef7 100644 --- a/internal/cmd/keepassxctemplatefuncs.go +++ b/internal/cmd/keepassxctemplatefuncs.go @@ -44,13 +44,8 @@ func (c *Config) keepassxcAttachmentTemplateFunc(entry, name string) string { panic(err) } if version.Compare(keepassxcHasAttachmentExportVersion) < 0 { - panic( - fmt.Sprintf( - "keepassxc-cli version %s required, found %s", - keepassxcHasAttachmentExportVersion, - version, - ), - ) + format := "keepassxc-cli version %s required, found %s" + panic(fmt.Sprintf(format, keepassxcHasAttachmentExportVersion, version)) } if data, ok := c.Keepassxc.attachmentCache[entry][name]; ok { diff --git a/internal/cmd/mackupcmd_darwin.go b/internal/cmd/mackupcmd_darwin.go index 346e9cfb843..d5c190052ce 100644 --- a/internal/cmd/mackupcmd_darwin.go +++ b/internal/cmd/mackupcmd_darwin.go @@ -61,11 +61,7 @@ func (c *Config) newMackupCmd() *cobra.Command { return mackupCmd } -func (c *Config) runMackupAddCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runMackupAddCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { mackupApplicationsDir, err := c.mackupApplicationsDir() if err != nil { return err diff --git a/internal/cmd/main_test.go b/internal/cmd/main_test.go index 601895d62ad..55d2397789f 100644 --- a/internal/cmd/main_test.go +++ b/internal/cmd/main_test.go @@ -151,12 +151,8 @@ func cmdCmpMod(ts *testscript.TestScript, neg bool, args []string) { ts.Fatalf("%s unexpectedly has mode %03o", args[1], fileInfo.Mode().Perm()) } if !neg && !equal { - ts.Fatalf( - "%s has mode %03o, expected %03o", - args[1], - fileInfo.Mode().Perm(), - fs.FileMode(mode64)&^chezmoitest.Umask, - ) + format := "%s has mode %03o, expected %03o" + ts.Fatalf(format, args[1], fileInfo.Mode().Perm(), fs.FileMode(mode64)&^chezmoitest.Umask) } } diff --git a/internal/cmd/managedcmd.go b/internal/cmd/managedcmd.go index 8d7bfd09e84..fae67e8f4c1 100644 --- a/internal/cmd/managedcmd.go +++ b/internal/cmd/managedcmd.go @@ -40,11 +40,7 @@ func (c *Config) newManagedCmd() *cobra.Command { return managedCmd } -func (c *Config) runManagedCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runManagedCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { // Build queued relPaths. When there are no arguments, start from root, // otherwise start from arguments. var relPaths chezmoi.RelPaths @@ -65,10 +61,7 @@ func (c *Config) runManagedCmd( return nil } - targetStateEntry, err := sourceStateEntry.TargetStateEntry( - c.destSystem, - c.DestDirAbsPath.Join(targetRelPath), - ) + targetStateEntry, err := sourceStateEntry.TargetStateEntry(c.destSystem, c.DestDirAbsPath.Join(targetRelPath)) if err != nil { return err } diff --git a/internal/cmd/managedcmd_test.go b/internal/cmd/managedcmd_test.go index 828239d6a97..438f0e6b98b 100644 --- a/internal/cmd/managedcmd_test.go +++ b/internal/cmd/managedcmd_test.go @@ -106,14 +106,8 @@ func TestManagedCmd(t *testing.T) { t.Run(tc.name, func(t *testing.T) { chezmoitest.WithTestFS(t, tc.root, func(fileSystem vfs.FS) { stdout := &bytes.Buffer{} - assert.NoError( - t, - newTestConfig( - t, - fileSystem, - withStdout(stdout), - ).execute(append([]string{"managed"}, tc.args...)), - ) + config := newTestConfig(t, fileSystem, withStdout(stdout)) + assert.NoError(t, config.execute(append([]string{"managed"}, tc.args...))) assert.Equal(t, tc.expectedOutput, stdout.String()) }) }) diff --git a/internal/cmd/mergecmd.go b/internal/cmd/mergecmd.go index 3b670179660..03057b11059 100644 --- a/internal/cmd/mergecmd.go +++ b/internal/cmd/mergecmd.go @@ -36,11 +36,7 @@ func (c *Config) newMergeCmd() *cobra.Command { return mergeCmd } -func (c *Config) runMergeCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runMergeCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeInSourceState: true, mustBeManaged: false, @@ -63,10 +59,7 @@ func (c *Config) runMergeCmd( // doMerge is the core merge functionality. It invokes the merge tool to do a // three-way merge between the destination, source, and target, including // transparently decrypting the file in the source state. -func (c *Config) doMerge( - targetRelPath chezmoi.RelPath, - sourceStateEntry chezmoi.SourceStateEntry, -) (err error) { +func (c *Config) doMerge(targetRelPath chezmoi.RelPath, sourceStateEntry chezmoi.SourceStateEntry) (err error) { sourceAbsPath := c.SourceDirAbsPath.Join(sourceStateEntry.SourceRelPath().RelPath()) // If the source state entry is an encrypted file, then decrypt it to a @@ -79,9 +72,7 @@ func (c *Config) doMerge( if plaintextTempDirAbsPath, err = c.tempDir("chezmoi-merge-plaintext"); err != nil { return } - plaintextAbsPath = plaintextTempDirAbsPath.Join( - sourceStateEntry.SourceRelPath().RelPath(), - ) + plaintextAbsPath = plaintextTempDirAbsPath.Join(sourceStateEntry.SourceRelPath().RelPath()) defer chezmoierrors.CombineFunc(&err, func() error { return os.RemoveAll(plaintextTempDirAbsPath.String()) }) diff --git a/internal/cmd/onepasswordtemplatefuncs.go b/internal/cmd/onepasswordtemplatefuncs.go index ae6349df679..591c9b8c1d1 100644 --- a/internal/cmd/onepasswordtemplatefuncs.go +++ b/internal/cmd/onepasswordtemplatefuncs.go @@ -202,10 +202,7 @@ func (c *Config) onepasswordItem(userArgs []string) (*onepasswordItem, error) { return &item, nil } -func (c *Config) onepasswordOutput( - args *onepasswordArgs, - withSessionToken withSessionTokenType, -) ([]byte, error) { +func (c *Config) onepasswordOutput(args *onepasswordArgs, withSessionToken withSessionTokenType) ([]byte, error) { key := strings.Join(args.args, "\x00") if output, ok := c.Onepassword.outputCache[key]; ok { return output, nil diff --git a/internal/cmd/purgecmd.go b/internal/cmd/purgecmd.go index d518f1534d8..1d2db3687eb 100644 --- a/internal/cmd/purgecmd.go +++ b/internal/cmd/purgecmd.go @@ -60,10 +60,7 @@ func (c *Config) doPurge(options *doPurgeOptions) error { } if options.config { - absPaths = append(absPaths, - c.configFileAbsPath.Dir(), - c.configFileAbsPath, - ) + absPaths = append(absPaths, c.configFileAbsPath.Dir(), c.configFileAbsPath) } if options.persistentState { diff --git a/internal/cmd/readdcmd.go b/internal/cmd/readdcmd.go index f8bf6f329d1..d28ba79d2a5 100644 --- a/internal/cmd/readdcmd.go +++ b/internal/cmd/readdcmd.go @@ -41,11 +41,7 @@ func (c *Config) newReAddCmd() *cobra.Command { return reAddCmd } -func (c *Config) runReAddCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { var targetRelPaths chezmoi.RelPaths sourceStateEntries := make(map[chezmoi.RelPath]chezmoi.SourceStateEntry) if len(args) == 0 { diff --git a/internal/cmd/removecmd.go b/internal/cmd/removecmd.go index 04dd48c7b38..bc3ec6e39d4 100644 --- a/internal/cmd/removecmd.go +++ b/internal/cmd/removecmd.go @@ -43,11 +43,7 @@ func (c *Config) newRemoveCmd() *cobra.Command { return removeCmd } -func (c *Config) runRemoveCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runRemoveCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeManaged: true, recursive: c.remove.recursive, diff --git a/internal/cmd/statuscmd_test.go b/internal/cmd/statuscmd_test.go index a4d90ace905..40fca23d4a6 100644 --- a/internal/cmd/statuscmd_test.go +++ b/internal/cmd/statuscmd_test.go @@ -56,31 +56,17 @@ func TestStatusCmd(t *testing.T) { t.Run(tc.name, func(t *testing.T) { chezmoitest.WithTestFS(t, tc.root, func(fileSystem vfs.FS) { stdout := strings.Builder{} - assert.NoError( - t, - newTestConfig( - t, - fileSystem, - withStdout(&stdout), - ).execute(append([]string{"status"}, tc.args...)), - ) + config1 := newTestConfig(t, fileSystem, withStdout(&stdout)) + assert.NoError(t, config1.execute(append([]string{"status"}, tc.args...))) assert.Equal(t, tc.stdoutStr, stdout.String()) - assert.NoError( - t, - newTestConfig(t, fileSystem).execute(append([]string{"apply"}, tc.args...)), - ) + config2 := newTestConfig(t, fileSystem) + assert.NoError(t, config2.execute(append([]string{"apply"}, tc.args...))) vfst.RunTests(t, fileSystem, "", tc.postApplyTests...) stdout.Reset() - assert.NoError( - t, - newTestConfig( - t, - fileSystem, - withStdout(&stdout), - ).execute(append([]string{"status"}, tc.args...)), - ) + config3 := newTestConfig(t, fileSystem, withStdout(&stdout)) + assert.NoError(t, config3.execute(append([]string{"status"}, tc.args...))) assert.Zero(t, stdout.String()) }) }) diff --git a/internal/cmd/symlinks_test.go b/internal/cmd/symlinks_test.go index a3759d96e3a..b8e8eb77e8f 100644 --- a/internal/cmd/symlinks_test.go +++ b/internal/cmd/symlinks_test.go @@ -77,10 +77,7 @@ func TestSymlinks(t *testing.T) { if tc.extraRoot != nil { assert.NoError(t, vfst.NewBuilder().Build(fileSystem, tc.extraRoot)) } - assert.NoError( - t, - newTestConfig(t, fileSystem).execute(append([]string{"apply"}, tc.args...)), - ) + assert.NoError(t, newTestConfig(t, fileSystem).execute(append([]string{"apply"}, tc.args...))) vfst.RunTests(t, fileSystem, "", tc.tests) assert.NoError(t, newTestConfig(t, fileSystem).execute([]string{"verify"})) }) diff --git a/internal/cmd/unmanagedcmd.go b/internal/cmd/unmanagedcmd.go index cf707a002e6..d0127a265a1 100644 --- a/internal/cmd/unmanagedcmd.go +++ b/internal/cmd/unmanagedcmd.go @@ -37,11 +37,7 @@ func (c *Config) newUnmanagedCmd() *cobra.Command { return unmanagedCmd } -func (c *Config) runUnmanagedCmd( - cmd *cobra.Command, - args []string, - sourceState *chezmoi.SourceState, -) error { +func (c *Config) runUnmanagedCmd(cmd *cobra.Command, args []string, sourceState *chezmoi.SourceState) error { var absPaths chezmoi.AbsPaths if len(args) == 0 { absPaths = append(absPaths, c.DestDirAbsPath) diff --git a/internal/cmd/upgradecmd.go b/internal/cmd/upgradecmd.go index 8737d5512e9..17ff59beba7 100644 --- a/internal/cmd/upgradecmd.go +++ b/internal/cmd/upgradecmd.go @@ -125,12 +125,7 @@ func (c *Config) runUpgradeCmd(cmd *cobra.Command, args []string) error { case err != nil: return err case method == "": - return fmt.Errorf( - "%s/%s: cannot determine upgrade method for %s", - runtime.GOOS, - runtime.GOARCH, - executableAbsPath, - ) + return fmt.Errorf("%s/%s: cannot determine upgrade method for %s", runtime.GOOS, runtime.GOARCH, executableAbsPath) } } c.logger.Info(). @@ -188,10 +183,7 @@ func (c *Config) runUpgradeCmd(cmd *cobra.Command, args []string) error { return chezmoilog.LogCmdRun(chezmoiVersionCmd) } -func (c *Config) getChecksums( - ctx context.Context, - rr *github.RepositoryRelease, -) (map[string][]byte, error) { +func (c *Config) getChecksums(ctx context.Context, rr *github.RepositoryRelease) (map[string][]byte, error) { name := fmt.Sprintf( "%s_%s_checksums.txt", c.upgrade.repo, @@ -247,7 +239,9 @@ func (c *Config) downloadURL(ctx context.Context, url string) ([]byte, error) { } func (c *Config) replaceExecutable( - ctx context.Context, executableFilenameAbsPath chezmoi.AbsPath, releaseVersion *semver.Version, + ctx context.Context, + executableFilenameAbsPath chezmoi.AbsPath, + releaseVersion *semver.Version, rr *github.RepositoryRelease, ) (err error) { var archiveFormat chezmoi.ArchiveFormat @@ -259,40 +253,16 @@ func (c *Config) replaceExecutable( if libc, err = getLibc(); err != nil { return } - archiveName = fmt.Sprintf( - "%s_%s_%s-%s_%s.tar.gz", - c.upgrade.repo, - releaseVersion, - runtime.GOOS, - libc, - runtime.GOARCH, - ) + archiveName = fmt.Sprintf("%s_%s_%s-%s_%s.tar.gz", c.upgrade.repo, releaseVersion, runtime.GOOS, libc, runtime.GOARCH) case runtime.GOOS == "linux" && runtime.GOARCH == "386": archiveFormat = chezmoi.ArchiveFormatTarGz - archiveName = fmt.Sprintf( - "%s_%s_%s_i386.tar.gz", - c.upgrade.repo, - releaseVersion, - runtime.GOOS, - ) + archiveName = fmt.Sprintf("%s_%s_%s_i386.tar.gz", c.upgrade.repo, releaseVersion, runtime.GOOS) case runtime.GOOS == "windows": archiveFormat = chezmoi.ArchiveFormatZip - archiveName = fmt.Sprintf( - "%s_%s_%s_%s.zip", - c.upgrade.repo, - releaseVersion, - runtime.GOOS, - runtime.GOARCH, - ) + archiveName = fmt.Sprintf("%s_%s_%s_%s.zip", c.upgrade.repo, releaseVersion, runtime.GOOS, runtime.GOARCH) default: archiveFormat = chezmoi.ArchiveFormatTarGz - archiveName = fmt.Sprintf( - "%s_%s_%s_%s.tar.gz", - c.upgrade.repo, - releaseVersion, - runtime.GOOS, - runtime.GOARCH, - ) + archiveName = fmt.Sprintf("%s_%s_%s_%s.tar.gz", c.upgrade.repo, releaseVersion, runtime.GOOS, runtime.GOARCH) } releaseAsset := getReleaseAssetByName(rr, archiveName) if releaseAsset == nil { @@ -344,12 +314,7 @@ func (c *Config) replaceExecutable( return } -func (c *Config) verifyChecksum( - ctx context.Context, - rr *github.RepositoryRelease, - name string, - data []byte, -) error { +func (c *Config) verifyChecksum(ctx context.Context, rr *github.RepositoryRelease, name string, data []byte) error { checksums, err := c.getChecksums(ctx, rr) if err != nil { return err diff --git a/internal/cmd/upgradecmd_unix.go b/internal/cmd/upgradecmd_unix.go index 63910302c41..74247397f95 100644 --- a/internal/cmd/upgradecmd_unix.go +++ b/internal/cmd/upgradecmd_unix.go @@ -67,11 +67,7 @@ func (c *Config) brewUpgrade() error { return c.run(chezmoi.EmptyAbsPath, "brew", []string{"upgrade", c.upgrade.repo}) } -func (c *Config) getPackageFilename( - packageType string, - version *semver.Version, - os, arch string, -) (string, error) { +func (c *Config) getPackageFilename(packageType string, version *semver.Version, os, arch string) (string, error) { if archReplacement, ok := archReplacements[packageType][arch]; ok { arch = archReplacement } @@ -92,7 +88,10 @@ func (c *Config) snapRefresh() error { } func (c *Config) upgradeUNIXPackage( - ctx context.Context, version *semver.Version, rr *github.RepositoryRelease, useSudo bool, + ctx context.Context, + version *semver.Version, + rr *github.RepositoryRelease, + useSudo bool, ) error { switch runtime.GOOS { case "linux": diff --git a/internal/cmd/upgradecmd_windows.go b/internal/cmd/upgradecmd_windows.go index 85befaa39b1..33b8b86eab5 100644 --- a/internal/cmd/upgradecmd_windows.go +++ b/internal/cmd/upgradecmd_windows.go @@ -89,7 +89,10 @@ func (c *Config) snapRefresh() error { } func (c *Config) upgradeUNIXPackage( - ctx context.Context, version *semver.Version, rr *github.RepositoryRelease, useSudo bool, + ctx context.Context, + version *semver.Version, + rr *github.RepositoryRelease, + useSudo bool, ) error { return errUnsupportedUpgradeMethod } diff --git a/internal/cmds/lint-whitespace/main.go b/internal/cmds/lint-whitespace/main.go index 4977c9b2f40..0b07d2d9d84 100644 --- a/internal/cmds/lint-whitespace/main.go +++ b/internal/cmds/lint-whitespace/main.go @@ -41,27 +41,14 @@ func lintData(filename string, data []byte) error { for i, line := range lines { switch { case crlfLineEndingRx.Match(line): - errs = append( - errs, - fmt.Errorf("::error file=%s,line=%d::CRLF line ending", filename, i+1), - ) + errs = append(errs, fmt.Errorf("::error file=%s,line=%d::CRLF line ending", filename, i+1)) case trailingWhitespaceRx.Match(line): - errs = append( - errs, - fmt.Errorf("::error file=%s,line=%d::trailing whitespace", filename, i+1), - ) + errs = append(errs, fmt.Errorf("::error file=%s,line=%d::trailing whitespace", filename, i+1)) } } if len(data) > 0 && len(lines[len(lines)-1]) != 0 { - errs = append( - errs, - fmt.Errorf( - "::error file=%s,line=%d::no newline at end of file", - filename, - len(lines)+1, - ), - ) + errs = append(errs, fmt.Errorf("::error file=%s,line=%d::no newline at end of file", filename, len(lines)+1)) } return chezmoierrors.Combine(errs...)
chore
Join some long lines
9f01e42aef127fe1524969616555c89815454b1b
2022-02-15 04:40:51
Tom Payne
chore: Avoid partial updates in ArchLinux test
false
diff --git a/assets/docker/archlinux.Dockerfile b/assets/docker/archlinux.Dockerfile index 68d9fd0ff3a..836c8a6e400 100644 --- a/assets/docker/archlinux.Dockerfile +++ b/assets/docker/archlinux.Dockerfile @@ -1,6 +1,6 @@ FROM archlinux:latest -RUN pacman -Sy --noconfirm --noprogressbar age gcc git go unzip zip +RUN pacman -Syu --noconfirm age gcc git go unzip zip COPY assets/docker/entrypoint.sh /entrypoint.sh ENTRYPOINT /entrypoint.sh
chore
Avoid partial updates in ArchLinux test
7be7dfecc3dc7031a72ca1d963efd1a7982573c0
2021-11-30 04:53:37
Tom Payne
chore: Add Go version check to doctor command
false
diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index c15393128f0..4062c043df2 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -87,6 +87,9 @@ type fileCheck struct { ifNotExist checkResult } +// A goVersionCheck checks the Go version. +type goVersionCheck struct{} + // An osArchCheck checks that runtime.GOOS and runtime.GOARCH are supported. type osArchCheck struct{} @@ -138,6 +141,7 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { versionStr: c.versionStr, }, &osArchCheck{}, + &goVersionCheck{}, &executableCheck{}, &upgradeMethodCheck{}, &configFileCheck{ @@ -451,6 +455,14 @@ func (c *fileCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) ( } } +func (goVersionCheck) Name() string { + return "go-version" +} + +func (goVersionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { + return checkResultOK, fmt.Sprintf("%s (%s)", runtime.Version(), runtime.Compiler) +} + func (osArchCheck) Name() string { return "os-arch" }
chore
Add Go version check to doctor command
35a26c7c0ad9157a58517132c6a688f287741da0
2025-02-21 07:13:27
Tom Payne
chore: Update tools
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb366836e23..2319526f43b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ env: GOVERSIONINFO_VERSION: 1.4.1 # https://github.com/josephspurrier/goversioninfo/releases PYTHON_VERSION: '3.10' # https://www.python.org/downloads/ RAGE_VERSION: 0.11.1 # https://github.com/str4d/rage/releases - UV_VERSION: 0.6.1 # https://github.com/astral-sh/uv/releases + UV_VERSION: 0.6.2 # https://github.com/astral-sh/uv/releases jobs: changes: runs-on: ubuntu-22.04
chore
Update tools
6788c5436c779d962d982a526d0e5288d66534ae
2024-02-15 00:11:07
Austin Ziegler
feat: 1Password Secrets Automation Support
false
diff --git a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml index a6d3d5c2901..884a2865bf9 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml +++ b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml @@ -329,6 +329,9 @@ sections: type: bool default: '`true`' description: Prompt for sign-in when no valid session is available + mode: + default: '`account`' + description: See [1Password Secrets Automation](../../user-guide/password-managers/1password.md#secrets-automation) pass: command: default: '`pass`' diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/index.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/index.md index 59be71b94ec..4c6ad1d83a6 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/index.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/index.md @@ -4,16 +4,14 @@ The `onepassword*` template functions return structured data from [1Password](https://1password.com/) using the [1Password CLI](https://developer.1password.com/docs/cli) (`op`). -!!! warning - - When using the 1Password CLI with biometric authentication, account - shorthand names are not available. In order to assist with this, chezmoi - supports multiple derived values from `op account list` that can be changed - into the appropriate 1Password *account-uuid*. +!!! info - ### Example + When using the 1Password CLI with biometric authentication, chezmoi derives + values from `op account list` that can resolves into the appropriate + 1Password *account-uuid*. - If `op account list --format=json` returns the following structure: + As an example, if `op account list --format=json` returns the following + structure: ```json [ @@ -44,3 +42,11 @@ CLI](https://developer.1password.com/docs/cli) (`op`). `account1.1password.ca` will not be a valid lookup value, but `my@account1`, `[email protected]`, `your@account1`, and `[email protected]` would all be valid lookups. + +!!! warning + + Chezmoi has experimental support for [1Password secrets + automation](../../user-guide/password-managers/1password.md#secrets-automation) + modes. These modes change how the 1Password CLI works and affect all + functions. Most notably, `account` parameters are not allowed on all + 1Password template functions. diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepassword.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepassword.md index 2796a8f1e06..cd0a04fec24 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepassword.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepassword.md @@ -1,4 +1,4 @@ -# `onepassword` *uuid* [*vault-uuid* [*account-name*]] +# `onepassword` *uuid* [*vault* [*account*]] `onepassword` returns structured data from [1Password](https://1password.com/) using the [1Password @@ -6,8 +6,8 @@ CLI](https://support.1password.com/command-line-getting-started/) (`op`). *uuid* is passed to `op item get $UUID --format json` and the output from `op` is parsed as JSON. The output from `op` is cached so calling `onepassword` multiple times with the same *uuid* will only invoke `op` once. If the optional -*vault-uuid* is supplied, it will be passed along to the `op item get` call, -which can significantly improve performance. If the optional *account-name* is +*vault* is supplied, it will be passed along to the `op item get` call, +which can significantly improve performance. If the optional *account* is supplied, it will be passed along to the `op item get` call, which will help it look in the right account, in case you have multiple accounts (e.g., personal and work accounts). @@ -38,13 +38,8 @@ config variable. {{ end }} ``` - !!! info +!!! warning - For 1Password CLI 1.x. - - ``` - {{ (onepassword "$UUID").details.password }} - {{ (onepassword "$UUID" "$VAULT_UUID").details.password }} - {{ (onepassword "$UUID" "$VAULT_UUID" "$ACCOUNT_NAME").details.password }} - {{ (onepassword "$UUID" "" "$ACCOUNT_NAME").details.password }} - ``` + When using [1Password secrets + automation](../../user-guide/password-managers/1password.md#secrets-automation), + the *account* parameter is not allowed. diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDetailsFields.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDetailsFields.md index 795dee3bc9c..94c21f46555 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDetailsFields.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDetailsFields.md @@ -1,4 +1,4 @@ -# `onepasswordDetailsFields` *uuid* [*vault-uuid* [*account-name*]] +# `onepasswordDetailsFields` *uuid* [*vault* [*account*]] `onepasswordDetailsFields` returns structured data from [1Password](https://1password.com/) using the [1Password @@ -12,8 +12,8 @@ interactively prompted to sign in. The output from `op` is cached so calling `onepasswordDetailsFields` multiple times with the same *uuid* will only invoke `op` once. If the optional -*vault-uuid* is supplied, it will be passed along to the `op get` call, which -can significantly improve performance. If the optional _account-name_ is +*vault* is supplied, it will be passed along to the `op get` call, which +can significantly improve performance. If the optional _account_ is supplied, it will be passed along to the `op get` call, which will help it look in the right account, in case you have multiple accounts (e.g. personal and work accounts). @@ -71,3 +71,10 @@ accounts). } } ``` + + +!!! warning + + When using [1Password secrets + automation](../../user-guide/password-managers/1password.md#secrets-automation), + the *account* parameter is not allowed. diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDocument.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDocument.md index cee23232551..e847db98cbd 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDocument.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordDocument.md @@ -1,13 +1,13 @@ -# `onepasswordDocument` *uuid* [*vault-uuid* [*account-name*]] +# `onepasswordDocument` *uuid* [*vault* [*account*]] `onepasswordDocument` returns a document from [1Password](https://1password.com/) using the [1Password CLI](https://developer.1password.com/docs/cli) (`op`). *uuid* is passed to `op get document $UUID` and the output from `op` is returned. The output from `op` is cached so calling `onepasswordDocument` multiple times with the same *uuid* -will only invoke `op` once. If the optional *vault-uuid* is supplied, it will be +will only invoke `op` once. If the optional *vault* is supplied, it will be passed along to the `op get` call, which can significantly improve performance. -If the optional _account-name_ is supplied, it will be passed along to the `op +If the optional _account_ is supplied, it will be passed along to the `op get` call, which will help it look in the right account, in case you have multiple accounts (e.g., personal and work accounts). @@ -22,3 +22,13 @@ interactively prompted to sign in. {{- onepasswordDocument "$UUID" "$VAULT_UUID" "$ACCOUNT_NAME" -}} {{- onepasswordDocument "$UUID" "" "$ACCOUNT_NAME" -}} ``` + +!!! warning + + When using [1Password Connect](../../user-guide/password-managers/1password.md#1password-connect), `onepasswordDocument` is not available. + +!!! warning + + When using [1Password Service + Accounts](../../user-guide/password-managers/1password.md#1password-service-accounts), + the *account* parameter is not allowed. diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordItemFields.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordItemFields.md index b89bf95c93e..04179557249 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordItemFields.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordItemFields.md @@ -1,4 +1,4 @@ -# `onepasswordItemFields` *uuid* [*vault-uuid* [*account-name*]] +# `onepasswordItemFields` *uuid* [*vault* [*account*]] `onepasswordItemFields` returns structured data from [1Password](https://1password.com/) using the [1Password @@ -72,45 +72,8 @@ interactively prompted to sign in. } ``` - !!! info +!!! warning - For 1Password CLI 1.x, the output is this: - - ```json - { - "uuid": "$UUID", - "details": { - "sections": [ - { - "name": "linked items", - "title": "Related Items" - }, - { - "fields": [ - { - "k": "string", - "n": "D4328E0846D2461E8E455D7A07B93397", - "t": "exampleLabel", - "v": "exampleValue" - } - ], - "name": "Section_20E0BD380789477D8904F830BFE8A121", - "title": "" - } - ] - }, - } - ``` - - the return value of `onepasswordItemFields` will be the map: - - ```json - { - "exampleLabel": { - "k": "string", - "n": "D4328E0846D2461E8E455D7A07B93397", - "t": "exampleLabel", - "v": "exampleValue" - } - } - ``` + When using [1Password secrets + automation](../../user-guide/password-managers/1password.md#secrets-automation), + the *account* parameter is not allowed. diff --git a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordRead.md b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordRead.md index 147bdf3ded0..44fefe230d7 100644 --- a/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordRead.md +++ b/assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordRead.md @@ -21,3 +21,9 @@ interactively prompted to sign in. ```console $ op read --no-newline op://vault/item/field ``` + +!!! warning + + When using [1Password secrets + automation](../../user-guide/password-managers/1password.md#secrets-automation), + the *account* parameter is not allowed. diff --git a/assets/chezmoi.io/docs/user-guide/password-managers/1password.md b/assets/chezmoi.io/docs/user-guide/password-managers/1password.md index 42d8fe6b818..915a6fb9fc3 100644 --- a/assets/chezmoi.io/docs/user-guide/password-managers/1password.md +++ b/assets/chezmoi.io/docs/user-guide/password-managers/1password.md @@ -32,9 +32,9 @@ Documents can be retrieved with: {{- onepasswordDocument "$UUID" -}} ``` -The output of `op item get $UUID--format json` (`op get item $UUID`) is -available as the `onepassword` template function. chezmoi parses the JSON output -and returns it as structured data. For example, if the output is: +The output of `op item get $UUID --format json` is available as the +`onepassword` template function. chezmoi parses the JSON output and returns it +as structured data. For example, if the output is: ```json { @@ -93,25 +93,6 @@ or: {{ end }} ``` -!!! info - - 1Password CLI 1.x returns a simpler structure: - - ```json - { - "uuid": "$UUID", - "details": { - "password": "$PASSWORD" - } - } - ``` - - This allows for the syntax: - - ``` - {{ (onepassword "$UUID").details.password }} - ``` - `onepasswordDetailsFields` returns a reworked version of the structure that allows the fields to be queried by key: @@ -146,23 +127,17 @@ Additional fields may be obtained with `onepasswordItemFields`; not all objects in 1Password have item fields. This can be tested with: ```console -$ chezmoi execute-template "{{ onepasswordItemFields \"$UUID\" | toJson }}" | jq . +$ chezmoi execute-template "{{ onepasswordItemFields \"$UUID\" | toJson }}" | \ + jq . ``` -!!! note - - The extra `-` after the opening `{{` and before the closing `}}` instructs - the template language to remove any whitespace before and after the - substitution. This removes any trailing newline added by your editor when - saving the template. - ## Sign-in prompt chezmoi will verify the availability and validity of a session token in the current environment. If it is missing or expired, you will be interactively prompted to sign-in again. -In the past chezmoi used to simply exit with an error when no valid session was +In the past chezmoi used to exit with an error when no valid session was available. If you'd like to restore this behavior, set the `onepassword.prompt` configuration variable to `false`, for example: @@ -173,6 +148,71 @@ configuration variable to `false`, for example: !!! danger - Do not use prompt on shared machines. A session token verified or acquired + Do not use `prompt` on shared machines. A session token verified or acquired interactively will be passed to the 1Password CLI through a command line parameter, which is visible to other users of the same system. + +## Secrets Automation + +chezmoi has experimental support for secrets automation with [1Password +Connect](https://developer.1password.com/docs/connect/) and [1Password Service +Accounts](https://developer.1password.com/docs/service-accounts). These might be +used on restricted machines where you cannot or do not wish to install a full +1Password desktop application. + +When these features are used, the behavior of the 1Password CLI changes, so +chezmoi requires explicit configuration for either connect or service account +modes using the `onepassword.mode` configuration option. The default, if not +specified, is `account`: + +```toml title="~/.config/chezmoi/chezmoi.toml" +[onepassword] + mode = "account" +``` + +In `account` mode, chezmoi will stop with an error if the environment variable +`OP_SERVICE_ACCOUNT_TOKEN` is set, or if both environment variables +`OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` are set. + +!!! info + + Both 1Password Connect and Service Accounts prevent the CLI from working + with multiple accounts. If you need access to secrets from more than one + 1Password account, do not use these features with chezmoi. + +### 1Password Connect + +Once 1Password Connect is +[configured](https://developer.1password.com/docs/connect/connect-cli#requirements), +and `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` are properly set, set +`onepassword.mode` to `connect`. + +```toml title="~/.config/chezmoi/chezmoi.toml" +[onepassword] + mode = "connect" +``` + +In `connect` mode: + +- the `onepasswordDocument` template function is not available, +- `account` parameters are not allowed in 1Password template functions, +- chezmoi will stop with an error if one or both of `OP_CONNECT_HOST` and + `OP_CONNECT_TOKEN` are unset, or if `OP_SERVICE_ACCOUNT_TOKEN` is set. + +### 1Password Service Accounts + +Once a 1Password service account has been +[created](https://developer.1password.com/docs/service-accounts/use-with-1password-cli/#requirements) +and `OP_SERVICE_ACCOUNT_TOKEN` is properly set, set `onepassword.mode` to +`service`. + +```toml title="~/.config/chezmoi/chezmoi.toml" +[onepassword] + mode = "service" +``` + +In `service` mode: + +- `account` parameters are not allowed in 1Password template functions, +- chezmoi will stop with an error if `OP_SERVICE_ACCOUNT_TOKEN` is unset, or if + both of `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` are set. diff --git a/internal/cmd/config.go b/internal/cmd/config.go index d5e7a486ae3..3a6db01e32b 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -2700,6 +2700,7 @@ func newConfigFile(bds *xdg.BaseDirectorySpecification) ConfigFile { Onepassword: onepasswordConfig{ Command: "op", Prompt: true, + Mode: onepasswordModeAccount, }, Pass: passConfig{ Command: "pass", diff --git a/internal/cmd/onepasswordtemplatefuncs.go b/internal/cmd/onepasswordtemplatefuncs.go index bc7c2281700..a7054ba644b 100644 --- a/internal/cmd/onepasswordtemplatefuncs.go +++ b/internal/cmd/onepasswordtemplatefuncs.go @@ -2,6 +2,7 @@ package cmd import ( "encoding/json" + "errors" "fmt" "os" "os/exec" @@ -13,6 +14,14 @@ import ( "github.com/twpayne/chezmoi/v2/internal/chezmoilog" ) +type onepasswordMode string + +const ( + onepasswordModeAccount onepasswordMode = "account" + onepasswordModeConnect onepasswordMode = "connect" + onepasswordModeService onepasswordMode = "service" +) + type withSessionTokenType bool const ( @@ -34,12 +43,14 @@ type onepasswordAccount struct { } type onepasswordConfig struct { - Command string `json:"command" mapstructure:"command" yaml:"command"` - Prompt bool `json:"prompt" mapstructure:"prompt" yaml:"prompt"` + Command string `json:"command" mapstructure:"command" yaml:"command"` + Prompt bool `json:"prompt" mapstructure:"prompt" yaml:"prompt"` + Mode onepasswordMode `json:"mode" mapstructure:"mode" yaml:"mode"` outputCache map[string][]byte sessionTokens map[string]string accountMap map[string]string accountMapErr error + modeChecked bool } type onepasswordArgs struct { @@ -54,6 +65,10 @@ type onepasswordItem struct { } func (c *Config) onepasswordTemplateFunc(userArgs ...string) map[string]any { + if err := c.onepasswordCheckMode(); err != nil { + panic(err) + } + args, err := c.newOnepasswordArgs([]string{"item", "get", "--format", "json"}, userArgs) if err != nil { panic(err) @@ -95,6 +110,14 @@ func (c *Config) onepasswordDetailsFieldsTemplateFunc(userArgs ...string) map[st } func (c *Config) onepasswordDocumentTemplateFunc(userArgs ...string) string { + if err := c.onepasswordCheckMode(); err != nil { + panic(err) + } + + if c.Onepassword.Mode == onepasswordModeConnect { + panic(fmt.Errorf("onepasswordDocument cannot be used in %s mode", onepasswordModeConnect)) + } + args, err := c.newOnepasswordArgs([]string{"document", "get"}, userArgs) if err != nil { panic(err) @@ -202,7 +225,7 @@ func (c *Config) onepasswordOutput(args *onepasswordArgs, withSessionToken withS } commandArgs := args.args - if withSessionToken { + if c.Onepassword.Mode == onepasswordModeAccount && withSessionToken { sessionToken, err := c.onepasswordGetOrRefreshSessionToken(args) if err != nil { return nil, err @@ -229,6 +252,10 @@ func (c *Config) onepasswordOutput(args *onepasswordArgs, withSessionToken withS } func (c *Config) onepasswordReadTemplateFunc(url string, args ...string) string { + if err := c.onepasswordCheckMode(); err != nil { + panic(err) + } + onepasswordArgs := &onepasswordArgs{ args: []string{"read", "--no-newline", url}, } @@ -237,10 +264,14 @@ func (c *Config) onepasswordReadTemplateFunc(url string, args ...string) string case 0: // Do nothing. case 1: + if err := onepasswordCheckInvalidAccountParameters(c.Onepassword.Mode); err != nil { + panic(err) + } + onepasswordArgs.account = c.onepasswordAccount(args[0]) onepasswordArgs.args = append(onepasswordArgs.args, "--account", onepasswordArgs.account) default: - panic(fmt.Errorf("expected 1 or 2 arguments, got %d", len(args))) + panic(fmt.Errorf("expected 1..2 arguments, got %d", len(args)+1)) } output, err := c.onepasswordOutput(onepasswordArgs, withSessionToken) @@ -251,6 +282,11 @@ func (c *Config) onepasswordReadTemplateFunc(url string, args ...string) string } func (c *Config) onepasswordAccount(key string) string { + // This should not happen, but better to be safe + if err := onepasswordCheckInvalidAccountParameters(c.Onepassword.Mode); err != nil { + panic(err) + } + accounts, err := c.onepasswordAccounts() if err != nil { panic(err) @@ -265,6 +301,11 @@ func (c *Config) onepasswordAccount(key string) string { // onepasswordAccounts returns a map of keys to unique account UUIDs. func (c *Config) onepasswordAccounts() (map[string]string, error) { + // This should not happen, but better to be safe + if err := onepasswordCheckInvalidAccountParameters(c.Onepassword.Mode); err != nil { + return nil, err + } + if c.Onepassword.accountMap != nil || c.Onepassword.accountMapErr != nil { return c.Onepassword.accountMap, c.Onepassword.accountMapErr } @@ -290,8 +331,19 @@ func (c *Config) onepasswordAccounts() (map[string]string, error) { } func (c *Config) newOnepasswordArgs(baseArgs, userArgs []string) (*onepasswordArgs, error) { - if len(userArgs) < 1 || 3 < len(userArgs) { - return nil, fmt.Errorf("expected 1, 2, or 3 arguments, got %d", len(userArgs)) + maxArgs := 3 + if c.Onepassword.Mode != onepasswordModeAccount { + maxArgs = 2 + } + + // `session` and `connect` modes do not support the account parameter. Better + // to error out early. + if len(userArgs) < 1 || maxArgs < len(userArgs) { + if err := onepasswordCheckInvalidAccountParameters(c.Onepassword.Mode); maxArgs < len(userArgs) && err != nil { + return nil, err + } + + return nil, fmt.Errorf("expected 1..%d arguments in %s mode, got %d", maxArgs, c.Onepassword.Mode, len(userArgs)) } a := &onepasswordArgs{ @@ -371,3 +423,58 @@ func onepasswordUniqueSessionToken(environ []string) string { } return token } + +// onepasswordCheckMode verifies that things are set up correctly for the +// 1Password mode. +func (c *Config) onepasswordCheckMode() error { + if c.Onepassword.modeChecked { + return nil + } + + c.Onepassword.modeChecked = true + + switch c.Onepassword.Mode { + case onepasswordModeAccount: + if os.Getenv("OP_SERVICE_ACCOUNT_TOKEN") != "" { + return errors.New("onepassword.mode is account, but OP_SERVICE_ACCOUNT_TOKEN is set") + } + + if os.Getenv("OP_CONNECT_HOST") != "" && os.Getenv("OP_CONNECT_TOKEN") != "" { + return errors.New("onepassword.mode is account, but OP_CONNECT_HOST and OP_CONNECT_TOKEN are set") + } + + case onepasswordModeConnect: + if os.Getenv("OP_CONNECT_HOST") == "" { + return errors.New("onepassword.mode is connect, but OP_CONNECT_HOST is not set") + } + + if os.Getenv("OP_CONNECT_TOKEN") == "" { + return errors.New("onepassword.mode is connect, but OP_CONNECT_TOKEN is not set") + } + + if os.Getenv("OP_SERVICE_ACCOUNT_TOKEN") != "" { + return errors.New("onepassword.mode is connect, but OP_SERVICE_ACCOUNT_TOKEN is set") + } + + case onepasswordModeService: + if os.Getenv("OP_SERVICE_ACCOUNT_TOKEN") == "" { + return errors.New("onepassword.mode is service, but OP_SERVICE_ACCOUNT_TOKEN is not set") + } + + if os.Getenv("OP_CONNECT_HOST") != "" && os.Getenv("OP_CONNECT_TOKEN") != "" { + return errors.New("onepassword.mode is service, but OP_CONNECT_HOST and OP_CONNECT_TOKEN are set") + } + } + + return nil +} + +// onepasswordCheckInvalidAccountParameters returns the error "1Password +// account parameters cannot be used in %s mode" if the provided mode is not +// account mode. +func onepasswordCheckInvalidAccountParameters(mode onepasswordMode) error { + if mode != onepasswordModeAccount { + return fmt.Errorf("1Password account parameters cannot be used in %s mode", mode) + } + return nil +} diff --git a/internal/cmd/testdata/scripts/onepassword2.txtar b/internal/cmd/testdata/scripts/onepassword2.txtar index 10d0dabf41a..c1f9316b649 100644 --- a/internal/cmd/testdata/scripts/onepassword2.txtar +++ b/internal/cmd/testdata/scripts/onepassword2.txtar @@ -33,58 +33,139 @@ stdout exampleField exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" "account" }}' stdout exampleAccountField +# test onepasswordDocument template function +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" }}' +stdout 'OK-COMPUTER' + +# test onepasswordDocument template function with vault +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "vault" }}' +stdout 'OK-VAULT' + +# test onepasswordDocument template function with vault and account +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "vault" "account" }}' +stdout 'OK-VAULT-ACCOUNT' + +# test onepasswordDocument template function with account +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "" "account" }}' +stdout 'OK-ACCOUNT' + +# test onepassword template function (insufficient parameters) +! exec chezmoi execute-template '{{ (onepassword).id }}' +stderr 'expected 1..3 arguments in account mode, got 0' + +# test onepassword template function (too many parameters) +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "vault" "account" "extra").id }}' +stderr 'expected 1..3 arguments in account mode, got 4' + +# test onepasswordRead template function (too many parameters) +! exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" "account" "extra" }}' +stderr 'expected 1..2 arguments, got 3' + +# test failure with OP_SERVICE_ACCOUNT_TOKEN set +env OP_SERVICE_ACCOUNT_TOKEN=x +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_SERVICE_ACCOUNT_TOKEN is set' + +# test failure with OP_CONNECT_HOST and OP_CONNECT_TOKEN set +env OP_SERVICE_ACCOUNT_TOKEN= +env OP_CONNECT_HOST=x +env OP_CONNECT_TOKEN=y +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_CONNECT_HOST and OP_CONNECT_TOKEN' + -- bin/op -- #!/bin/sh -case "$*" in -"--version") +if [ "$*" = "--version" ]; then echo 2.0.0 - ;; -"item get --format json ExampleLogin" | "item get --format json ExampleLogin --vault vault --account account_uuid" | "--session thisIsAFakeSessionToken item get --format json ExampleLogin" | "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" | "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid") +elif [ "$*" = "item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "item get --format json ExampleLogin --account account_uuid" ]; then echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' - ;; -"account list --format=json") +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "item get --format json ExampleLogin" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "account list --format=json" ]; then echo '[{"url":"account.1password.com","email":"[email protected]","user_uuid":"user_uuid","account_uuid":"account_uuid"}]' - ;; -"signin --raw" | "signin --account account_uuid --raw") +elif [ "$*" = "signin --account account_uuid --raw" ]; then + echo 'thisIsAFakeSessionToken' +elif [ "$*" = "signin --raw" ]; then echo 'thisIsAFakeSessionToken' - ;; -"--session thisIsAFakeSessionToken read --no-newline op://vault/item/field") +elif [ "$*" = "read --no-newline op://vault/item/field" ]; then echo 'exampleField' - ;; -"--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid") +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ]; then + echo 'exampleField' +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ]; then echo 'exampleAccountField' - ;; -*) +elif [ "$*" = "document get exampleDocument" ]; then + echo 'OK-COMPUTER' +elif [ "$*" = "document get exampleDocument --vault vault" ]; then + echo 'OK-VAULT' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument" ]; then + echo 'OK-COMPUTER' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ]; then + echo 'OK-VAULT' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ]; then + echo 'OK-ACCOUNT' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ]; then + echo 'OK-VAULT-ACCOUNT' +else echo [ERROR] 2020/01/01 00:00:00 unknown command \"$*\" for \"op\" 1>&2 exit 1 -esac +fi -- bin/op.cmd -- @echo off IF "%*" == "--version" ( echo 2.0.0 -) ELSE IF "%*" == "item get --format json ExampleLogin" ( - echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} ) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault --account account_uuid" ( echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} ) ELSE IF "%*" == "item get --format json ExampleLogin --account account_uuid" ( echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} -) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ( - echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} ) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ( echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} ) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ( echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "item get --format json ExampleLogin" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} ) ELSE IF "%*" == "account list --format=json" ( echo.[{"url":"account.1password.com","email":"[email protected]","user_uuid":"user_uuid","account_uuid":"account_uuid"}] +) ELSE IF "%*" == "signin --account account_uuid --raw" ( + echo thisIsAFakeSessionToken +) ELSE IF "%*" == "signin --raw" ( + echo thisIsAFakeSessionToken +) ELSE IF "%*" == "document get exampleDocument" ( + echo.OK-COMPUTER +) ELSE IF "%*" == "document get exampleDocument --vault vault" ( + echo.OK-VAULT +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument" ( + echo.OK-COMPUTER +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ( + echo.OK-VAULT +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ( + echo.OK-ACCOUNT +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ( + echo.OK-VAULT-ACCOUNT +) ELSE IF "%*" == "read --no-newline op://vault/item/field" ( + echo.exampleField ) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ( echo.exampleField ) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ( echo.exampleAccountField -) ELSE IF "%*" == "signin --raw" ( - echo thisIsAFakeSessionToken -) ELSE IF "%*" == "signin --account account_uuid --raw" ( - echo thisIsAFakeSessionToken ) ELSE ( echo.[ERROR] 2020/01/01 00:00:00 unknown command "%*" for "op" 1>&2 exit /b 1 diff --git a/internal/cmd/testdata/scripts/onepassword2connect.txtar b/internal/cmd/testdata/scripts/onepassword2connect.txtar new file mode 100644 index 00000000000..b79e1388a37 --- /dev/null +++ b/internal/cmd/testdata/scripts/onepassword2connect.txtar @@ -0,0 +1,189 @@ +[unix] chmod 755 bin/op +[windows] unix2dos bin/op.cmd + +mkhomedir + +# test that mode is properly set and reported +exec chezmoi execute-template '{{ .chezmoi.config.onepassword.mode }}' +stdout '^connect$' + +# test failure without OP_CONNECT_HOST set +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_CONNECT_HOST' + +env OP_CONNECT_HOST=x + +# test failure without OP_CONNECT_TOKEN set +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_CONNECT_TOKEN' + +env OP_CONNECT_TOKEN=y + +# test onepassword template function +exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test onepassword template function with vault +exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "vault").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test failure onepassword template function with vault and account +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "vault" "account").id }}' +stderr '1Password account parameters cannot be used in connect mode' + +# test onepassword template function with empty vault +exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test onepasswordDetailsFields template function +exec chezmoi execute-template '{{ (onepasswordDetailsFields "ExampleLogin").password.value }}' +stdout '^L8rm1JXJIE1b8YUDWq7h$' + +# test onepasswordItemFields template function +exec chezmoi execute-template '{{ (onepasswordItemFields "ExampleLogin").exampleLabel.value }}' +stdout exampleValue + +# test onepasswordRead template function +exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" }}' +stdout exampleField + +# test failure onepasswordRead template function with account +! exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" "account" }}' +stderr '1Password account parameters cannot be used in connect mode' + +# test failure onepasswordDocument template function +! exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" }}' +stderr 'onepasswordDocument cannot be used in connect mode' + +# test failure with OP_SERVICE_ACCOUNT_TOKEN set +env OP_SERVICE_ACCOUNT_TOKEN=x +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_SERVICE_ACCOUNT_TOKEN is set' + +-- bin/op -- +#!/bin/sh + +if [ "$*" = "--version" ]; then + echo 2.0.0 +elif [ "$*" = "item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "item get --format json ExampleLogin --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "item get --format json ExampleLogin" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "item get --format json ExampleLogin --vault vault" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ]; then + echo "[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ]; then + echo "[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "account list --format=json" ]; then + echo "[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "signin --account account_uuid --raw" ]; then + echo "[ERROR] cannot sign in with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "signin --raw" ]; then + echo "[ERROR] cannot sign in with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "read --no-newline op://vault/item/field" ]; then + echo 'exampleField' +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ]; then + echo "[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ]; then + echo "[ERROR] cannot use session tokens or accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "document get exampleDocument" ]; then + echo "[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument" ]; then + echo "[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ]; then + echo "[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ]; then + echo "[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set" 1>&2 + exit 1 +else + echo "[ERROR] 2020/01/01 00:00:00 unknown command \"$*\" for \"op\"" 1>&2 + exit 1 +fi +-- bin/op.cmd -- +@echo off +IF "%*" == "--version" ( + echo 2.0.0 +) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "item get --format json ExampleLogin --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "item get --format json ExampleLogin" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ( + echo.[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ( + echo.[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "account list --format=json" ( + echo.[ERROR] cannot use accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "signin --account account_uuid --raw" ( + echo.[ERROR] cannot sign in with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "signin --raw" ( + echo.[ERROR] cannot sign in with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 +) ELSE IF "%*" == "document get exampleDocument" ( + echo.[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument" ( + echo.[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ( + echo.[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ( + echo.[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ( + echo.[ERROR] cannot use document get with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "read --no-newline op://vault/item/field" ( + echo.exampleField +) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ( + echo.[ERROR] cannot use session tokens with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ( + echo.[ERROR] cannot use session tokens or accounts with OP_CONNECT_HOST and OP_CONNECT_TOKEN set 1>&2 + exit /b 1 +) ELSE ( + echo "[ERROR] 2020/01/01 00:00:00 unknown command \"%*\" for \"op\"" 1>&2 + exit /b 1 +) +-- home/user/.config/chezmoi/chezmoi.toml -- +[onepassword] +mode = "connect" diff --git a/internal/cmd/testdata/scripts/onepassword2service.txtar b/internal/cmd/testdata/scripts/onepassword2service.txtar new file mode 100644 index 00000000000..7aae04a1976 --- /dev/null +++ b/internal/cmd/testdata/scripts/onepassword2service.txtar @@ -0,0 +1,198 @@ +[unix] chmod 755 bin/op +[windows] unix2dos bin/op.cmd + +mkhomedir + +# test that mode is properly set and reported +exec chezmoi execute-template '{{ .chezmoi.config.onepassword.mode }}' +stdout '^service$' + +# test failure without OP_SERVICE_ACCOUNT_TOKEN set +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_SERVICE_ACCOUNT_TOKEN is not set' + +env OP_SERVICE_ACCOUNT_TOKEN=x + +# test onepassword template function +exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test onepassword template function with vault +exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "vault").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test failure onepassword template function with vault and account +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "vault" "account").id }}' +stderr '1Password account parameters cannot be used in service mode' + +# test onepassword template function with empty vault +exec chezmoi execute-template '{{ (onepassword "ExampleLogin" "").id }}' +stdout '^wxcplh5udshnonkzg2n4qx262y$' + +# test onepasswordDetailsFields template function +exec chezmoi execute-template '{{ (onepasswordDetailsFields "ExampleLogin").password.value }}' +stdout '^L8rm1JXJIE1b8YUDWq7h$' + +# test onepasswordItemFields template function +exec chezmoi execute-template '{{ (onepasswordItemFields "ExampleLogin").exampleLabel.value }}' +stdout exampleValue + +# test onepasswordRead template function +exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" }}' +stdout exampleField + +# test failure onepasswordRead template function with account +! exec chezmoi execute-template '{{ onepasswordRead "op://vault/item/field" "account" }}' +stderr '1Password account parameters cannot be used in service mode' + +# test onepasswordDocument template function +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" }}' +stdout 'OK-COMPUTER' + +# test onepasswordDocument template function with vault +exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "vault" }}' +stdout 'OK-VAULT' + +# test onepasswordDocument template function with vault and account +! exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "vault" "account" }}' +stderr '1Password account parameters cannot be used in service mode' + +# test onepasswordDocument template function with account +! exec chezmoi execute-template '{{ onepasswordDocument "exampleDocument" "" "account" }}' +stderr '1Password account parameters cannot be used in service mode' + +# test failure with OP_CONNECT_HOST and OP_CONNECT_TOKEN set +env OP_CONNECT_HOST=x +env OP_CONNECT_TOKEN=y +! exec chezmoi execute-template '{{ (onepassword "ExampleLogin").id }}' +stderr 'OP_CONNECT_HOST and OP_CONNECT_TOKEN' + +-- bin/op -- +#!/bin/sh + +if [ "$*" = "--version" ]; then + echo 2.0.0 +elif [ "$*" = "item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "item get --format json ExampleLogin --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ]; then + echo "[ERROR] cannot use accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "item get --format json ExampleLogin" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "item get --format json ExampleLogin --vault vault" ]; then + echo '{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]}' +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ]; then + echo "[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ]; then + echo "[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "account list --format=json" ]; then + echo "[ERROR] cannot use accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "signin --account account_uuid --raw" ]; then + echo "[ERROR] cannot sign in with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "signin --raw" ]; then + echo "[ERROR] cannot sign in with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "document get exampleDocument" ]; then + echo 'OK-COMPUTER' +elif [ "$*" = "document get exampleDocument --vault vault" ]; then + echo 'OK-VAULT' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument" ]; then + echo "[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ]; then + echo 'OK-VAULT' +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ]; then + echo "[ERROR] cannot use accounts or session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ]; then + echo "[ERROR] cannot use accounts or session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "read --no-newline op://vault/item/field" ]; then + echo 'exampleField' +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ]; then + echo "[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +elif [ "$*" = "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ]; then + echo "[ERROR] cannot use session tokens or accounts with OP_SERVICE_TOKEN set" 1>&2 + exit 1 +else + echo "[ERROR] 2020/01/01 00:00:00 unknown command \"$*\" for \"op\"" 1>&2 + exit 1 +fi +-- bin/op.cmd -- +@echo off +IF "%*" == "--version" ( + echo 2.0.0 +) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "item get --format json ExampleLogin --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --account account_uuid" ( + echo.[ERROR] cannot use accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "item get --format json ExampleLogin" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "item get --format json ExampleLogin --vault vault" ( + echo.{"id":"wxcplh5udshnonkzg2n4qx262y","title":"ExampleLogin","version":1,"vault":{"id":"tscpxgi6s7c662jtqn3vmw4n5a"},"category":"LOGIN","last_edited_by":"YO4UTYPAD3ZFBNZG5DVAZFBNZM","created_at":"2022-01-17T01:53:50Z","updated_at":"2022-01-17T01:55:35Z","sections":[{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"}],"fields":[{"id":"username","type":"STRING","purpose":"USERNAME","label":"username","value":"exampleuser "},{"id":"password","type":"CONCEALED","purpose":"PASSWORD","label":"password","value":"L8rm1JXJIE1b8YUDWq7h","password_details":{"strength":"EXCELLENT"}},{"id":"notesPlain","type":"STRING","purpose":"NOTES","label":"notesPlain"},{"id":"cqn7oda7wkcsar7rzcr52i2m3u","section":{"id":"Section_cdzjhg2jo7jylpyin2f5mbfnhm","label":"Related Items"},"type":"STRING","label":"exampleLabel","value":"exampleValue"}],"urls":[{"primary":true,"href":"https://www.example.com/"}]} +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin --vault vault" ( + echo.[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken item get --format json ExampleLogin" ( + echo.[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "account list --format=json" ( + echo.[ERROR] cannot use accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "signin --account account_uuid --raw" ( + echo.[ERROR] cannot sign in with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "signin --raw" ( + echo.[ERROR] cannot sign in with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "document get exampleDocument" ( + echo.OK-COMPUTER +) ELSE IF "%*" == "document get exampleDocument --vault vault" ( + echo.OK-VAULT +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument" ( + echo.[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault" ( + echo.[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --account account_uuid" ( + echo.[ERROR] cannot use accounts or session tokens with OP_SERVICE_TOKEN set 1>&2 + exit 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken document get exampleDocument --vault vault --account account_uuid" ( + echo.[ERROR] cannot use accounts or session tokens with OP_SERVICE_TOKEN set 1>&2 + exit 1 +) ELSE IF "%*" == "read --no-newline op://vault/item/field" ( + echo.exampleField +) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field" ( + echo.[ERROR] cannot use session tokens with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE IF "%*" == "--session thisIsAFakeSessionToken read --no-newline op://vault/item/field --account account_uuid" ( + echo.[ERROR] cannot use session tokens or accounts with OP_SERVICE_TOKEN set 1>&2 + exit /b 1 +) ELSE ( + echo "[ERROR] 2020/01/01 00:00:00 unknown command \"%*\" for \"op\"" 1>&2 + exit /b 1 +) +-- home/user/.config/chezmoi/chezmoi.toml -- +[onepassword] +mode = "service"
feat
1Password Secrets Automation Support
a18e6d5ce64f28fbb2daa027dd9224bfa8cce471
2022-02-22 02:00:30
Tom Payne
chore: Tidy up use of append
false
diff --git a/pkg/chezmoi/autotemplate.go b/pkg/chezmoi/autotemplate.go index 5f43730bcb3..e5dc2efdcad 100644 --- a/pkg/chezmoi/autotemplate.go +++ b/pkg/chezmoi/autotemplate.go @@ -84,10 +84,11 @@ func extractVariablesHelper( for name, value := range data { switch value := value.(type) { case string: - variables = append(variables, templateVariable{ + variable := templateVariable{ name: strings.Join(append(parent, name), "."), value: value, - }) + } + variables = append(variables, variable) case map[string]interface{}: variables = extractVariablesHelper(variables, append(parent, name), value) } diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 97a2f544142..26b24108f20 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -990,10 +990,11 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { if s.Ignore(destEntryRelPath) { continue } - allSourceStateEntries[destEntryRelPath] = append(allSourceStateEntries[destEntryRelPath], &SourceStateRemove{ + sourceStateRemove := &SourceStateRemove{ sourceRelPath: sourceStateDir.sourceRelPath, targetRelPath: destEntryRelPath, - }) + } + allSourceStateEntries[destEntryRelPath] = append(allSourceStateEntries[destEntryRelPath], sourceStateRemove) } case errors.Is(err, fs.ErrNotExist): // Do nothing.
chore
Tidy up use of append
885487b969a299f0536797bf23031f969efe4c97
2024-03-01 05:48:53
Tom Payne
docs: Add link to blog post
false
diff --git a/assets/chezmoi.io/docs/links/articles.md.yaml b/assets/chezmoi.io/docs/links/articles.md.yaml index 6899efb6044..4eb18567a91 100644 --- a/assets/chezmoi.io/docs/links/articles.md.yaml +++ b/assets/chezmoi.io/docs/links/articles.md.yaml @@ -381,3 +381,7 @@ articles: version: 2.43.0 title: Chezmore Chezmoi url: https://www.grumpymetalguy.com/tech_stack/chezmore/ +- date: '2024-02-25' + version: 2.47.0 + title: Atuin and chezmoi are the dog's bollocks + url: https://henry.catalinismith.com/2024/02/25/atuin-and-chezmoi-are-the-dogs-bollocks
docs
Add link to blog post
a547d55b076a73304fc7a498fa1dc7e50c0483c9
2021-12-22 20:00:27
Tom Payne
chore: Short circuit verify command
false
diff --git a/internal/chezmoi/erroronwritesystem.go b/internal/chezmoi/erroronwritesystem.go new file mode 100644 index 00000000000..a1ba67cb52a --- /dev/null +++ b/internal/chezmoi/erroronwritesystem.go @@ -0,0 +1,123 @@ +package chezmoi + +import ( + "io/fs" + "os/exec" + + vfs "github.com/twpayne/go-vfs/v4" +) + +// An ErrorOnWriteSystem is an System that passes reads to the wrapped System +// and returns an error if it is written to. +type ErrorOnWriteSystem struct { + system System + err error +} + +// NewErrorOnWriteSystem returns a new ErrorOnWriteSystem that wraps fs. +func NewErrorOnWriteSystem(system System, err error) *ErrorOnWriteSystem { + return &ErrorOnWriteSystem{ + system: system, + err: err, + } +} + +// Chmod implements System.Chmod. +func (s *ErrorOnWriteSystem) Chmod(name AbsPath, mode fs.FileMode) error { + return s.err +} + +// Glob implements System.Glob. +func (s *ErrorOnWriteSystem) Glob(pattern string) ([]string, error) { + return s.system.Glob(pattern) +} + +// IdempotentCmdCombinedOutput implements System.IdempotentCmdCombinedOutput. +func (s *ErrorOnWriteSystem) IdempotentCmdCombinedOutput(cmd *exec.Cmd) ([]byte, error) { + return s.system.IdempotentCmdCombinedOutput(cmd) +} + +// IdempotentCmdOutput implements System.IdempotentCmdOutput. +func (s *ErrorOnWriteSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error) { + return s.system.IdempotentCmdOutput(cmd) +} + +// Link implements System.Link. +func (s *ErrorOnWriteSystem) Link(oldname, newname AbsPath) error { + return s.err +} + +// Lstat implements System.Lstat. +func (s *ErrorOnWriteSystem) Lstat(name AbsPath) (fs.FileInfo, error) { + return s.system.Lstat(name) +} + +// Mkdir implements System.Mkdir. +func (s *ErrorOnWriteSystem) Mkdir(name AbsPath, perm fs.FileMode) error { + return s.err +} + +// RawPath implements System.RawPath. +func (s *ErrorOnWriteSystem) RawPath(path AbsPath) (AbsPath, error) { + return s.system.RawPath(path) +} + +// ReadDir implements System.ReadDir. +func (s *ErrorOnWriteSystem) ReadDir(name AbsPath) ([]fs.DirEntry, error) { + return s.system.ReadDir(name) +} + +// ReadFile implements System.ReadFile. +func (s *ErrorOnWriteSystem) ReadFile(name AbsPath) ([]byte, error) { + return s.system.ReadFile(name) +} + +// Readlink implements System.Readlink. +func (s *ErrorOnWriteSystem) Readlink(name AbsPath) (string, error) { + return s.system.Readlink(name) +} + +// RemoveAll implements System.RemoveAll. +func (s *ErrorOnWriteSystem) RemoveAll(AbsPath) error { + return s.err +} + +// Rename implements System.Rename. +func (s *ErrorOnWriteSystem) Rename(oldpath, newpath AbsPath) error { + return s.err +} + +// RunCmd implements System.RunCmd. +func (s *ErrorOnWriteSystem) RunCmd(cmd *exec.Cmd) error { + return s.err +} + +// RunIdempotentCmd implements System.RunIdempotentCmd. +func (s *ErrorOnWriteSystem) RunIdempotentCmd(cmd *exec.Cmd) error { + return s.system.RunIdempotentCmd(cmd) +} + +// RunScript implements System.RunScript. +func (s *ErrorOnWriteSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte, interpreter *Interpreter) error { + return s.err +} + +// Stat implements System.Stat. +func (s *ErrorOnWriteSystem) Stat(name AbsPath) (fs.FileInfo, error) { + return s.system.Stat(name) +} + +// UnderlyingFS implements System.UnderlyingFS. +func (s *ErrorOnWriteSystem) UnderlyingFS() vfs.FS { + return s.system.UnderlyingFS() +} + +// WriteFile implements System.WriteFile. +func (s *ErrorOnWriteSystem) WriteFile(AbsPath, []byte, fs.FileMode) error { + return s.err +} + +// WriteSymlink implements System.WriteSymlink. +func (s *ErrorOnWriteSystem) WriteSymlink(string, AbsPath) error { + return s.err +} diff --git a/internal/cmd/verifycmd.go b/internal/cmd/verifycmd.go index cc8acf0747e..8cd8b5533d3 100644 --- a/internal/cmd/verifycmd.go +++ b/internal/cmd/verifycmd.go @@ -36,17 +36,11 @@ func (c *Config) newVerifyCmd() *cobra.Command { } func (c *Config) runVerifyCmd(cmd *cobra.Command, args []string) error { - dryRunSystem := chezmoi.NewDryRunSystem(c.destSystem) - if err := c.applyArgs(cmd.Context(), dryRunSystem, c.DestDirAbsPath, args, applyArgsOptions{ + errorOnWriteSystem := chezmoi.NewErrorOnWriteSystem(c.destSystem, chezmoi.ExitCodeError(1)) + return c.applyArgs(cmd.Context(), errorOnWriteSystem, c.DestDirAbsPath, args, applyArgsOptions{ include: c.verify.include.Sub(c.verify.exclude), init: c.verify.init, recursive: c.verify.recursive, umask: c.Umask, - }); err != nil { - return err - } - if dryRunSystem.Modified() { - return chezmoi.ExitCodeError(1) - } - return nil + }) }
chore
Short circuit verify command
2397a72d2815b968aa3dd4404eb66547af9dc23f
2023-07-06 02:03:55
Tom Payne
feat: Add archive-file externals
false
diff --git a/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md index bd8a0d961f1..b68c05c95cf 100644 --- a/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md +++ b/assets/chezmoi.io/docs/reference/special-files-and-directories/chezmoiexternal-format.md @@ -13,32 +13,33 @@ externals to be included on different machines. Entries are indexed by target name relative to the directory of the `.chezmoiexternal.$FORMAT` file, and must have a `type` and a `url` field. -`type` can be either `file`, `archive`, or `git-repo`. If the entry's parent -directories do not already exist in the source state then chezmoi will create -them as regular directories. +`type` can be either `file`, `archive`, `archive-file`, or `git-repo`. If the +entry's parent directories do not already exist in the source state then chezmoi +will create them as regular directories. Entries may have the following fields: -| Variable | Type | Default value | Description | -| ----------------- | -------- | ------------- | ------------------------------------------------------------- | -| `type` | string | *none* | External type (`file`, `archive`, or `git-repo`) | -| `encrypted` | bool | `false` | Whether the external is encrypted | -| `exact` | bool | `false` | Add `exact_` attribute to directories in archive | -| `exclude` | []string | *none* | Patterns to exclude from archive | -| `executable` | bool | `false` | Add `executable_` attribute to file | -| `format` | string | *autodetect* | Format of archive | -| `include` | []string | *none* | Patterns to include from archive | -| `refreshPeriod` | duration | `0` | Refresh period | -| `stripComponents` | int | `0` | Number of leading directory components to strip from archives | -| `url` | string | *none* | URL | -| `checksum.sha256` | string | *none* | Expected SHA256 checksum of data | -| `checksum.sha384` | string | *none* | Expected SHA384 checksum of data | -| `checksum.sha512` | string | *none* | Expected SHA512 checksum of data | -| `checksum.size` | int | *none* | Expected size of data | -| `clone.args` | []string | *none* | Extra args to `git clone` | -| `filter.command` | string | *none* | Command to filter contents | -| `filter.args` | []string | *none* | Extra args to command to filter contents | -| `pull.args` | []string | *none* | Extra args to `git pull` | +| Variable | Type | Default value | Description | +| ----------------- | -------- | ------------- | ---------------------------------------------------------------- | +| `type` | string | *none* | External type (`file`, `archive`, `archive-file`, or `git-repo`) | +| `encrypted` | bool | `false` | Whether the external is encrypted | +| `exact` | bool | `false` | Add `exact_` attribute to directories in archive | +| `exclude` | []string | *none* | Patterns to exclude from archive | +| `executable` | bool | `false` | Add `executable_` attribute to file | +| `format` | string | *autodetect* | Format of archive | +| `path` | string | *none* | Path to file in archive | +| `include` | []string | *none* | Patterns to include from archive | +| `refreshPeriod` | duration | `0` | Refresh period | +| `stripComponents` | int | `0` | Number of leading directory components to strip from archives | +| `url` | string | *none* | URL | +| `checksum.sha256` | string | *none* | Expected SHA256 checksum of data | +| `checksum.sha384` | string | *none* | Expected SHA384 checksum of data | +| `checksum.sha512` | string | *none* | Expected SHA512 checksum of data | +| `checksum.size` | int | *none* | Expected size of data | +| `clone.args` | []string | *none* | Extra args to `git clone` | +| `filter.command` | string | *none* | Command to filter contents | +| `filter.args` | []string | *none* | Extra args to command to filter contents | +| `pull.args` | []string | *none* | Extra args to `git pull` | If any of the optional `checksum.sha256`, `checksum.sha384`, or `checksum.sha512` fields are set, chezmoi will verify that the downloaded data @@ -84,6 +85,12 @@ determine whether an archive member is included: Excluded archive members do not generate source state entries, and, if they are directories, all of their children are also excluded. +If `type` is `archive-file` then the target is a file or symlink with the +contents of the entry `path` in the archive at `url`. The optional integer field +`stripComponents` will remove leading path components from the members of the +archive before comparing them with `path`. The behavior of `format` is the same +as for `archive`. + If `type` is `git-repo` then chezmoi will run `git clone $URL $TARGET_NAME` with the optional `clone.args` if the target does not exist. If the target exists, then chezmoi will run `git pull` with the optional `pull.args` to @@ -120,6 +127,10 @@ re-download unless forced. To force chezmoi to re-download URLs, pass the url = "https://github.com/romkatv/powerlevel10k/archive/v1.15.0.tar.gz" exact = true stripComponents = 1 + [".local/bin/age"] + type = "archive-file" + url = "https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-{{ .chezmoi.os }}-{{ .chezmoi.arch }}.tar.gz" + path = "age/age" ["www/adminer/plugins"] type = "archive" url = "https://api.github.com/repos/vrana/adminer/tarball" diff --git a/assets/chezmoi.io/docs/user-guide/include-files-from-elsewhere.md b/assets/chezmoi.io/docs/user-guide/include-files-from-elsewhere.md index a0da9cbc6c3..dac3f557cdf 100644 --- a/assets/chezmoi.io/docs/user-guide/include-files-from-elsewhere.md +++ b/assets/chezmoi.io/docs/user-guide/include-files-from-elsewhere.md @@ -113,24 +113,20 @@ to include ## Extract a single file from an archive -You can extract a single file from an archive using the `$ENTRY.filter.command` -and `$ENTRY.filter.args` variables in `.chezmoiexternal.$FORMAT`, for example: +You can extract a single file from an archive using the `archive-file` type in +`.chezmoiexternal.$FORMAT`, for example: ```toml title="~/.local/share/chezmoi/.chezmoiexternal.toml" -{{ $ageVersion := "1.0.0" -}} +{{ $ageVersion := "1.1.1" -}} [".local/bin/age"] - type = "file" + type = "archive-file" url = "https://github.com/FiloSottile/age/releases/download/v{{ $ageVersion }}/age-v{{ $ageVersion }}-{{ .chezmoi.os }}-{{ .chezmoi.arch }}.tar.gz" - executable = true - refreshPeriod = "168h" - [".local/bin/age".filter] - command = "tar" - args = ["--extract", "--file", "/dev/stdin", "--gzip", "--to-stdout", "age/age"] + path = "age/age" ``` This will extract the single archive member `age/age` from the given URL (which is computed for the current OS and architecture) to the target -`./local/bin/age` and set its executable bit. +`./local/bin/age`. ## Import archives diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 7cdfb97bc7f..8f28ba1e813 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -42,9 +42,10 @@ type ExternalType string // ExternalTypes. const ( - ExternalTypeArchive ExternalType = "archive" - ExternalTypeFile ExternalType = "file" - ExternalTypeGitRepo ExternalType = "git-repo" + ExternalTypeArchive ExternalType = "archive" + ExternalTypeArchiveFile ExternalType = "archive-file" + ExternalTypeFile ExternalType = "file" + ExternalTypeGitRepo ExternalType = "git-repo" ) var ( @@ -79,9 +80,10 @@ type External struct { Command string `json:"command" toml:"command" yaml:"command"` Args []string `json:"args" toml:"args" yaml:"args"` } `json:"filter" toml:"filter" yaml:"filter"` - Format ArchiveFormat `json:"format" toml:"format" yaml:"format"` - Include []string `json:"include" toml:"include" yaml:"include"` - Pull struct { + Format ArchiveFormat `json:"format" toml:"format" yaml:"format"` + Include []string `json:"include" toml:"include" yaml:"include"` + ArchivePath string `json:"path" toml:"path" yaml:"path"` + Pull struct { Args []string `json:"args" toml:"args" yaml:"args"` } `json:"pull" toml:"pull" yaml:"pull"` RefreshPeriod Duration `json:"refreshPeriod" toml:"refreshPeriod" yaml:"refreshPeriod"` @@ -2149,6 +2151,14 @@ func (s *SourceState) readExternal( switch external.Type { case ExternalTypeArchive: return s.readExternalArchive(ctx, externalRelPath, parentSourceRelPath, external, options) + case ExternalTypeArchiveFile: + return s.readExternalArchiveFile( + ctx, + externalRelPath, + parentSourceRelPath, + external, + options, + ) case ExternalTypeFile: return s.readExternalFile(ctx, externalRelPath, parentSourceRelPath, external, options) case ExternalTypeGitRepo: @@ -2167,19 +2177,11 @@ func (s *SourceState) readExternalArchive( external *External, options *ReadOptions, ) (map[RelPath][]SourceStateEntry, error) { - data, err := s.getExternalData(ctx, externalRelPath, external, options) + data, format, err := s.readExternalArchiveData(ctx, externalRelPath, external, options) if err != nil { return nil, err } - url, err := url.Parse(external.URL) - if err != nil { - return nil, fmt.Errorf("%s: %s: %w", externalRelPath, external.URL, err) - } - urlPath := url.Path - if external.Encrypted { - urlPath = strings.TrimSuffix(urlPath, s.encryption.EncryptedSuffix()) - } dirAttr := DirAttr{ TargetName: externalRelPath.Base(), Exact: external.Exact, @@ -2199,11 +2201,6 @@ func (s *SourceState) readExternalArchive( externalRelPath: {sourceStateDir}, } - format := external.Format - if format == ArchiveFormatUnknown { - format = GuessArchiveFormat(urlPath, data) - } - patternSet := newPatternSet() for _, includePattern := range external.Include { if err := patternSet.add(includePattern, patternSetInclude); err != nil { @@ -2331,6 +2328,143 @@ func (s *SourceState) readExternalArchive( return sourceStateEntries, nil } +// readExternalArchiveData reads an external archive's data and returns its data +// and format. +func (s *SourceState) readExternalArchiveData( + ctx context.Context, + externalRelPath RelPath, + external *External, + options *ReadOptions, +) ([]byte, ArchiveFormat, error) { + data, err := s.getExternalData(ctx, externalRelPath, external, options) + if err != nil { + return nil, ArchiveFormatUnknown, err + } + + url, err := url.Parse(external.URL) + if err != nil { + return nil, ArchiveFormatUnknown, fmt.Errorf( + "%s: %s: %w", + externalRelPath, + external.URL, + err, + ) + } + urlPath := url.Path + if external.Encrypted { + urlPath = strings.TrimSuffix(urlPath, s.encryption.EncryptedSuffix()) + } + + format := external.Format + if format == ArchiveFormatUnknown { + format = GuessArchiveFormat(urlPath, data) + } + + return data, format, nil +} + +// readExternalArchiveFile reads a file from an external archive and returns its +// SourceStateEntries. +func (s *SourceState) readExternalArchiveFile( + ctx context.Context, + externalRelPath RelPath, + parentSourceRelPath SourceRelPath, + external *External, + options *ReadOptions, +) (map[RelPath][]SourceStateEntry, error) { + if external.ArchivePath == "" { + return nil, fmt.Errorf("%s: missing path", externalRelPath) + } + + data, format, err := s.readExternalArchiveData(ctx, externalRelPath, external, options) + if err != nil { + return nil, err + } + + var sourceStateEntry SourceStateEntry + if err := WalkArchive(data, format, func(name string, fileInfo fs.FileInfo, r io.Reader, linkname string) error { + if external.StripComponents > 0 { + components := strings.Split(name, "/") + if len(components) <= external.StripComponents { + return nil + } + name = path.Join(components[external.StripComponents:]...) + } + switch { + case name == "": + return nil + case name != external.ArchivePath: + // If this entry is a directory and it cannot contain the file we + // are looking for then skip this directory. + if fileInfo.IsDir() && !strings.HasPrefix(external.ArchivePath, name) { + return fs.SkipDir + } + return nil + case fileInfo.Mode()&fs.ModeType == 0: + contents, err := io.ReadAll(r) + if err != nil { + return fmt.Errorf("%s: %w", name, err) + } + lazyContents := newLazyContents(contents) + fileAttr := FileAttr{ + TargetName: fileInfo.Name(), + Type: SourceFileTypeFile, + Empty: fileInfo.Size() == 0, + Executable: isExecutable(fileInfo), + Private: isPrivate(fileInfo), + ReadOnly: isReadOnly(fileInfo), + } + sourceRelPath := parentSourceRelPath.Join(NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix()))) + targetStateEntry := &TargetStateFile{ + lazyContents: lazyContents, + empty: fileAttr.Empty, + perm: fileAttr.perm() &^ s.umask, + sourceAttr: SourceAttr{ + External: true, + }, + } + sourceStateEntry = &SourceStateFile{ + lazyContents: lazyContents, + Attr: fileAttr, + origin: external, + sourceRelPath: sourceRelPath, + targetStateEntry: targetStateEntry, + } + return Break + case fileInfo.Mode()&fs.ModeType == fs.ModeSymlink: + fileAttr := FileAttr{ + TargetName: fileInfo.Name(), + Type: SourceFileTypeSymlink, + } + sourceRelPath := parentSourceRelPath.Join(NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix()))) + targetStateEntry := &TargetStateSymlink{ + lazyLinkname: newLazyLinkname(linkname), + sourceAttr: SourceAttr{ + External: true, + }, + } + sourceStateEntry = &SourceStateFile{ + Attr: fileAttr, + origin: external, + sourceRelPath: sourceRelPath, + targetStateEntry: targetStateEntry, + } + return Break + default: + return fmt.Errorf("%s: unsupported mode %o", name, fileInfo.Mode()&fs.ModeType) + } + }); err != nil { + return nil, err + } + if sourceStateEntry == nil { + return nil, fmt.Errorf("%s: path not found in %s", external.ArchivePath, external.URL) + } + + return map[RelPath][]SourceStateEntry{ + externalRelPath: {sourceStateEntry}, + }, nil +} + // ReadExternalDir returns all source state entries in an external_ dir. func (s *SourceState) readExternalDir( rootSourceAbsPath AbsPath, rootSourceRelPath SourceRelPath, rootTargetRelPath RelPath, diff --git a/pkg/cmd/testdata/scripts/external.txtar b/pkg/cmd/testdata/scripts/external.txtar index 7b75fef9203..083f58b8091 100644 --- a/pkg/cmd/testdata/scripts/external.txtar +++ b/pkg/cmd/testdata/scripts/external.txtar @@ -97,6 +97,12 @@ chhome home11/user stderr 'MD5 mismatch' stderr 'SHA256 mismatch' +chhome home12/user + +# test that chezmoi reads archive-file externals +exec chezmoi apply +cmp $HOME/.file golden/dir/file + -- archive/dir/file -- # contents of dir/file -- golden/.file -- @@ -130,6 +136,12 @@ stderr 'SHA256 mismatch' url = "{{ env "HTTPD_URL" }}/.corrupt-file" checksum.md5 = "49fe9018f97349cdd0a0ac7b7f668b05" checksum.sha256 = "634a4dd193c7b3b926d2e08026aa81a416fd41cec52854863b974af422495663" +-- home12/user/.local/share/chezmoi/.chezmoiexternal.toml -- +[".file"] + type = "archive-file" + url = "{{ env "HTTPD_URL" }}/archive.tar.gz" + path = "dir/file" + stripComponents = 1 -- home2/user/.local/share/chezmoi/.chezmoiexternal.toml -- [".file"] type = "file"
feat
Add archive-file externals
1e8a6495104e606396c2d78bb45e5262d8403200
2023-08-03 14:20:09
Tom Payne
feat: Extend re-add command to accept an optional list of targets
false
diff --git a/assets/chezmoi.io/docs/reference/commands/re-add.md b/assets/chezmoi.io/docs/reference/commands/re-add.md index 99e9c95d188..51395b0b82a 100644 --- a/assets/chezmoi.io/docs/reference/commands/re-add.md +++ b/assets/chezmoi.io/docs/reference/commands/re-add.md @@ -1,7 +1,11 @@ -# `re-add` +# `re-add` [*target*...] -Re-add all modified files in the target state. chezmoi will not overwrite -templates, and all entries that are not files are ignored. +Re-add modified files in the target state, preserving any `encrypted_` +attributes. chezmoi will not overwrite templates, and all entries that are not +files are ignored. + +If no *target*s are specified then all modified files are re-added. If one or +more *target*s are given then only those targets are re-added. !!! hint @@ -11,4 +15,5 @@ templates, and all entries that are not files are ignored. ```console $ chezmoi re-add + $ chezmoi re-add ~/.bashrc ``` diff --git a/internal/cmd/readdcmd.go b/internal/cmd/readdcmd.go index 708460ee9a3..f8bf6f329d1 100644 --- a/internal/cmd/readdcmd.go +++ b/internal/cmd/readdcmd.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io/fs" + "path/filepath" "sort" "github.com/spf13/cobra" @@ -22,7 +23,7 @@ func (c *Config) newReAddCmd() *cobra.Command { Long: mustLongHelp("re-add"), Example: example("re-add"), ValidArgsFunction: c.targetValidArgs, - Args: cobra.NoArgs, + Args: cobra.ArbitraryArgs, RunE: c.makeRunEWithSourceState(c.runReAddCmd), Annotations: newAnnotations( modifiesSourceDirectory, @@ -47,13 +48,29 @@ func (c *Config) runReAddCmd( ) error { var targetRelPaths chezmoi.RelPaths sourceStateEntries := make(map[chezmoi.RelPath]chezmoi.SourceStateEntry) - _ = sourceState.ForEach( - func(targetRelPath chezmoi.RelPath, sourceStateEntry chezmoi.SourceStateEntry) error { + if len(args) == 0 { + _ = sourceState.ForEach( + func(targetRelPath chezmoi.RelPath, sourceStateEntry chezmoi.SourceStateEntry) error { + targetRelPaths = append(targetRelPaths, targetRelPath) + sourceStateEntries[targetRelPath] = sourceStateEntry + return nil + }, + ) + } else { + for _, arg := range args { + arg = filepath.Clean(arg) + destAbsPath, err := chezmoi.NewAbsPathFromExtPath(arg, c.homeDirAbsPath) + if err != nil { + return err + } + targetRelPath, err := c.targetRelPath(destAbsPath) + if err != nil { + return err + } targetRelPaths = append(targetRelPaths, targetRelPath) - sourceStateEntries[targetRelPath] = sourceStateEntry - return nil - }, - ) + sourceStateEntries[targetRelPath] = sourceState.Get(targetRelPath) + } + } sort.Sort(targetRelPaths) TARGET_REL_PATH: diff --git a/internal/cmd/testdata/scripts/re-add.txtar b/internal/cmd/testdata/scripts/re-add.txtar index 87573ce557f..658305e2bc7 100644 --- a/internal/cmd/testdata/scripts/re-add.txtar +++ b/internal/cmd/testdata/scripts/re-add.txtar @@ -12,3 +12,12 @@ grep '# edited' $CHEZMOISOURCEDIR/dot_dir/file grep '# edited' $CHEZMOISOURCEDIR/dot_dir/exact_subdir/file exec chezmoi diff ! stdout . + +# test that chezmoi re-add adds only specified targets +edit $HOME/.file +edit $HOME/.dir/file +edit $HOME/.dir/subdir/file +exec chezmoi re-add ~/.dir/file +grep -count=1 '# edited' $CHEZMOISOURCEDIR/dot_file +grep -count=2 '# edited' $CHEZMOISOURCEDIR/dot_dir/file +grep -count=1 '# edited' $CHEZMOISOURCEDIR/dot_dir/exact_subdir/file
feat
Extend re-add command to accept an optional list of targets
a4d989b265edecfd92767bd1aaf2fe31eb0f359e
2022-02-27 04:11:37
Tom Payne
fix: Allow user and repo to set in install script
false
diff --git a/assets/scripts/install.sh b/assets/scripts/install.sh index 4a9a0916929..4107faf1a1f 100644 --- a/assets/scripts/install.sh +++ b/assets/scripts/install.sh @@ -8,12 +8,12 @@ set -e BINDIR=${BINDIR:-./bin} -GITHUB_USER=${GITHUB_USER:-twpayne} +CHEZMOI_USER_REPO=${CHEZMOI_USER_REPO:-twpayne/chezmoi} TAGARG=latest LOG_LEVEL=2 EXECARGS= -GITHUB_DOWNLOAD=https://github.com/${GITHUB_USER}/chezmoi/releases/download +GITHUB_DOWNLOAD=https://github.com/${CHEZMOI_USER_REPO}/releases/download tmpdir=$(mktemp -d) trap 'rm -rf ${tmpdir}' EXIT @@ -207,7 +207,7 @@ get_libc() { real_tag() { tag=$1 log_debug "checking GitHub for tag ${tag}" - release_url="https://github.com/${GITHUB_USER}/chezmoi/releases/${tag}" + release_url="https://github.com/${CHEZMOI_USER_REPO}/releases/${tag}" json=$(http_get "${release_url}" "Accept: application/json") if [ -z "${json}" ]; then log_err "real_tag error retrieving GitHub release ${tag}" diff --git a/internal/cmds/generate-install.sh/install.sh.tmpl b/internal/cmds/generate-install.sh/install.sh.tmpl index e25a421ab19..9699fe163e9 100644 --- a/internal/cmds/generate-install.sh/install.sh.tmpl +++ b/internal/cmds/generate-install.sh/install.sh.tmpl @@ -8,12 +8,12 @@ set -e BINDIR=${BINDIR:-./bin} -GITHUB_USER=${GITHUB_USER:-twpayne} +CHEZMOI_USER_REPO=${CHEZMOI_USER_REPO:-twpayne/chezmoi} TAGARG=latest LOG_LEVEL=2 EXECARGS= -GITHUB_DOWNLOAD=https://github.com/${GITHUB_USER}/chezmoi/releases/download +GITHUB_DOWNLOAD=https://github.com/${CHEZMOI_USER_REPO}/releases/download tmpdir=$(mktemp -d) trap 'rm -rf ${tmpdir}' EXIT @@ -189,7 +189,7 @@ get_libc() { real_tag() { tag=$1 log_debug "checking GitHub for tag ${tag}" - release_url="https://github.com/${GITHUB_USER}/chezmoi/releases/${tag}" + release_url="https://github.com/${CHEZMOI_USER_REPO}/releases/${tag}" json=$(http_get "${release_url}" "Accept: application/json") if [ -z "${json}" ]; then log_err "real_tag error retrieving GitHub release ${tag}"
fix
Allow user and repo to set in install script
51b402f7f9d08401b4d85240bb27c455e409f56b
2021-10-08 03:49:57
Tom Payne
chore: Minor git-related clean-ups
false
diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 6df496b533a..9af8fe691c9 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -25,6 +25,7 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/coreos/go-semver/semver" + gogit "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/format/diff" "github.com/google/gops/agent" "github.com/mitchellh/mapstructure" @@ -1603,13 +1604,13 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error workingTreeAbsPath := c.SourceDirAbsPath FOR: for { - if info, err := c.baseSystem.Stat(workingTreeAbsPath.Join(".git")); err == nil && info.IsDir() { + if info, err := c.baseSystem.Stat(workingTreeAbsPath.Join(gogit.GitDirName)); err == nil && info.IsDir() { c.WorkingTreeAbsPath = workingTreeAbsPath break FOR } prevWorkingTreeDirAbsPath := workingTreeAbsPath workingTreeAbsPath = workingTreeAbsPath.Dir() - if workingTreeAbsPath.Len() >= prevWorkingTreeDirAbsPath.Len() { + if workingTreeAbsPath == c.homeDirAbsPath || workingTreeAbsPath.Len() >= prevWorkingTreeDirAbsPath.Len() { c.WorkingTreeAbsPath = c.SourceDirAbsPath break FOR } diff --git a/internal/cmd/updatecmd.go b/internal/cmd/updatecmd.go index 255ec491e49..13119927bca 100644 --- a/internal/cmd/updatecmd.go +++ b/internal/cmd/updatecmd.go @@ -46,11 +46,11 @@ func (c *Config) newUpdateCmd() *cobra.Command { func (c *Config) runUpdateCmd(cmd *cobra.Command, args []string) error { if c.UseBuiltinGit.Value(c.useBuiltinGitAutoFunc) { - rawSourceAbsPath, err := c.baseSystem.RawPath(c.SourceDirAbsPath) + rawWorkingTreeAbsPath, err := c.baseSystem.RawPath(c.WorkingTreeAbsPath) if err != nil { return err } - repo, err := git.PlainOpen(rawSourceAbsPath.String()) + repo, err := git.PlainOpen(rawWorkingTreeAbsPath.String()) if err != nil { return err }
chore
Minor git-related clean-ups
dd57c6c1180e8afa2803e1841f6414c46749525e
2022-10-30 21:25:59
Tom Payne
chore: Add test for .chezmoiignore and scripts
false
diff --git a/pkg/cmd/testdata/scripts/issue-2510.txtar b/pkg/cmd/testdata/scripts/issue-2510.txtar new file mode 100644 index 00000000000..5a7ecd1e27a --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue-2510.txtar @@ -0,0 +1,48 @@ +# test that .chezmoiignore works with scripts +exec chezmoi diff +cmp stdout golden/diff + +chhome home2/user + +# test that .chezmoiignore works with scripts in .chezmoiscripts +exec chezmoi diff +cmp stdout golden/diff2 + +-- golden/diff -- +diff --git a/script-one.sh b/script-one.sh +index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5498fa48acd6f616d60604b94352958c5e967fc 100755 +--- a/script-one.sh ++++ b/script-one.sh +@@ -0,0 +1,3 @@ ++#!/bin/sh ++ ++echo "script one" +-- golden/diff2 -- +diff --git a/.chezmoiscripts/script-one.sh b/.chezmoiscripts/script-one.sh +index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5498fa48acd6f616d60604b94352958c5e967fc 100755 +--- a/.chezmoiscripts/script-one.sh ++++ b/.chezmoiscripts/script-one.sh +@@ -0,0 +1,3 @@ ++#!/bin/sh ++ ++echo "script one" +-- home/user/.local/share/chezmoi/.chezmoiignore -- +script-two.sh +-- home/user/.local/share/chezmoi/run_script-one.sh -- +#!/bin/sh + +echo "script one" +-- home/user/.local/share/chezmoi/run_script-two.sh -- +#!/bin/sh + +echo "script two" +-- home2/user/.local/share/chezmoi/.chezmoiignore -- +.chezmoiscripts/script-two.sh +-- home2/user/.local/share/chezmoi/.chezmoiscripts/run_script-one.sh -- +#!/bin/sh + +echo "script one" +-- home2/user/.local/share/chezmoi/.chezmoiscripts/run_script-two.sh -- +#!/bin/sh + +echo "script two"
chore
Add test for .chezmoiignore and scripts
9aabfbcc9b546d94c2348400627d4d15db0cb80c
2023-01-01 06:44:42
Tom Payne
chore: Refactor legacy Go test to use old stable Go
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0a325c5515..e3465f3c889 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,20 +121,16 @@ jobs: - name: test run: | ( cd assets/vagrant && ./test.sh freebsd13 ) - test-legacy-go: - strategy: - matrix: - go-version: - - 1.18.x + test-macos: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - runs-on: ubuntu-20.04 + runs-on: macos-11 steps: - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: cache: true - go-version: ${{ matrix.go-version }} + go-version: ${{ env.GO_VERSION }} - name: build run: | go build ./... @@ -144,24 +140,28 @@ jobs: - name: install-age run: | cd $(mktemp -d) - curl -fsSL https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz | tar xzf - + curl -fsSL https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-darwin-amd64.tar.gz | tar xzf - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} run: | - go test ./... - test-macos: + go test -race ./... + - name: test-install.sh + run: | + sh assets/scripts/install.sh + bin/chezmoi --version + test-oldstable-go: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - runs-on: macos-11 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: cache: true - go-version: ${{ env.GO_VERSION }} + go-version: oldstable - name: build run: | go build ./... @@ -171,18 +171,14 @@ jobs: - name: install-age run: | cd $(mktemp -d) - curl -fsSL https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-darwin-amd64.tar.gz | tar xzf - + curl -fsSL https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz | tar xzf - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} run: | - go test -race ./... - - name: test-install.sh - run: | - sh assets/scripts/install.sh - bin/chezmoi --version + go test ./... test-release: needs: changes runs-on: ubuntu-20.04 @@ -392,8 +388,8 @@ jobs: - test-debian-i386 - test-fedora - test-freebsd - - test-legacy-go - test-macos + - test-oldstable-go - test-release - test-ubuntu - test-website
chore
Refactor legacy Go test to use old stable Go
e2aa6275aa7b501b8a6a7ae5ceb3c3a991a38caf
2022-06-01 15:21:01
dependabot[bot]
chore(deps): bump golangci/golangci-lint-action from 3.1.0 to 3.2.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed8405c22a4..279cc375c65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -389,7 +389,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - - uses: golangci/golangci-lint-action@b517f99ae23d86ecc4c0dec08dcf48d2336abc29 + - uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc with: version: v${{ env.GOLANGCI_LINT_VERSION }} args: --timeout=5m
chore
bump golangci/golangci-lint-action from 3.1.0 to 3.2.0
8921b78dec55128c704bef05ec5202a6e48c3bb3
2024-01-08 23:58:18
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 2ad1b56bb21..48bf9fb5c56 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 github.com/Shopify/ejson v1.4.1 github.com/alecthomas/assert/v2 v2.4.1 - github.com/aws/aws-sdk-go-v2 v1.24.0 - github.com/aws/aws-sdk-go-v2/config v1.26.2 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.0 + github.com/aws/aws-sdk-go-v2 v1.24.1 + github.com/aws/aws-sdk-go-v2/config v1.26.3 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.17.1 @@ -45,12 +45,12 @@ require ( github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1 github.com/zalando/go-keyring v0.2.3 go.etcd.io/bbolt v1.3.8 - golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 + golang.org/x/crypto v0.18.0 + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc golang.org/x/oauth2 v0.15.0 - golang.org/x/sync v0.5.0 - golang.org/x/sys v0.15.0 - golang.org/x/term v0.15.0 + golang.org/x/sync v0.6.0 + golang.org/x/sys v0.16.0 + golang.org/x/term v0.16.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v3 v3.0.1 howett.net/plist v1.0.1 @@ -62,7 +62,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -71,23 +71,23 @@ require ( github.com/alecthomas/repr v0.3.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.16.13 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.14 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect github.com/aws/smithy-go v1.19.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradenhilton/cityhash v1.0.0 // indirect github.com/charmbracelet/harmonica v0.2.0 // indirect github.com/charmbracelet/lipgloss v0.9.1 // indirect - github.com/cloudflare/circl v1.3.6 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/creack/pty/v2 v2.0.0-20231209135443-03db72c7b76c // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect @@ -126,7 +126,7 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/shopspring/decimal v1.3.1 // indirect diff --git a/go.sum b/go.sum index ca6ec415103..f66ca56a79c 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occ github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= @@ -52,30 +54,52 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= +github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= +github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= github.com/aws/aws-sdk-go-v2/config v1.26.2 h1:+RWLEIWQIGgrz2pBPAUoGgNGs1TOyF4Hml7hCnYj2jc= github.com/aws/aws-sdk-go-v2/config v1.26.2/go.mod h1:l6xqvUxt0Oj7PI/SUXYLNyZ9T/yBPn3YTQcJLLOdtR8= +github.com/aws/aws-sdk-go-v2/config v1.26.3 h1:dKuc2jdp10y13dEEvPqWxqLoc0vF3Z9FC45MvuQSxOA= +github.com/aws/aws-sdk-go-v2/config v1.26.3/go.mod h1:Bxgi+DeeswYofcYO0XyGClwlrq3DZEXli0kLf4hkGA0= github.com/aws/aws-sdk-go-v2/credentials v1.16.13 h1:WLABQ4Cp4vXtXfOWOS3MEZKr6AAYUpMczLhgKtAjQ/8= github.com/aws/aws-sdk-go-v2/credentials v1.16.13/go.mod h1:Qg6x82FXwW0sJHzYruxGiuApNo31UEtJvXVSZAXeWiw= +github.com/aws/aws-sdk-go-v2/credentials v1.16.14 h1:mMDTwwYO9A0/JbOCOG7EOZHtYM+o7OfGWfu0toa23VE= +github.com/aws/aws-sdk-go-v2/credentials v1.16.14/go.mod h1:cniAUh3ErQPHtCQGPT5ouvSAQ0od8caTO9OOuufZOAE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 h1:v+HbZaCGmOwnTTVS86Fleq0vPzOd7tnJGbFhP0stNLs= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9/go.mod h1:Xjqy+Nyj7VDLBtCMkQYOw1QYfAEZCVLrfI0ezve8wd4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 h1:N94sVhRACtXyVcjXxrwK1SKFIJrA9pOJ5yu2eSHnmls= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9/go.mod h1:hqamLz7g1/4EJP+GH5NBhcUMLjW+gKLQabgyz6/7WAU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.0 h1:dPCRgAL4WD9tSMaDglRNGOiAtSTjkwNiUW5GDpWFfHA= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.0/go.mod h1:4Ae1NCLK6ghmjzd45Tc33GgCKhUWD2ORAlULtMO1Cbs= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1 h1:Sn3MAV9YeACCULaxNWWYFH1a6G4wYFwBn3/TA5MwE2Q= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.1/go.mod h1:qutL00aW8GSo2D0I6UEOqMvRS3ZyuBrOC1BLe5D2jPc= github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 h1:dGrs+Q/WzhsiUKh82SfTVN66QzyulXuMDTV/G8ZxOac= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.6/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 h1:Yf2MIo9x+0tyv76GljxzqA3WtC5mw7NmazD2chwjxE4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8= github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 h1:HJeiuZ2fldpd0WqngyMR6KW7ofkXNLyOaHwEIGm39Cs= github.com/aws/aws-sdk-go-v2/service/sts v1.26.6/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U= github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/aymanbagabas/go-osc52 v1.0.3 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg= @@ -105,6 +129,8 @@ github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9 github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg= github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= @@ -275,6 +301,8 @@ github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -374,8 +402,12 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= @@ -397,6 +429,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -418,6 +452,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -425,6 +461,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
chore
Update dependencies
36ff9489b0ce5be667611d520a4392dff091808b
2023-05-02 00:52:31
Tom Payne
fix: Respect executable file modes in external_ directories
false
diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 4e8f1969c46..bdb2d713a1c 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -2157,6 +2157,7 @@ func (s *SourceState) readExternalDir( TargetName: fileInfo.Name(), Type: SourceFileTypeFile, Empty: true, + Executable: isExecutable(fileInfo), Private: isPrivate(fileInfo), ReadOnly: isReadOnly(fileInfo), } diff --git a/pkg/cmd/testdata/scripts/issue2964.txtar b/pkg/cmd/testdata/scripts/issue2964.txtar new file mode 100644 index 00000000000..2eacf91f6cb --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue2964.txtar @@ -0,0 +1,11 @@ +[windows] skip 'UNIX only' + +chmod 755 $CHEZMOISOURCEDIR/external_dot_dir/executable + +# test that external_ directories respect the executable bit +exec chezmoi apply +[umask:002] cmpmod 775 $HOME/.dir/executable +[umask:022] cmpmod 755 $HOME/.dir/executable + +-- home/user/.local/share/chezmoi/external_dot_dir/executable -- +# contents of .dir/executable
fix
Respect executable file modes in external_ directories
1f07deefaa797de9c11a494788cae92b65e00c01
2023-12-12 03:40:22
Tom Payne
chore: Tidy up mackup code
false
diff --git a/.golangci.yml b/.golangci.yml index 375d59113cd..8ecc76fdad7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -114,7 +114,7 @@ linters-settings: - ^compress/gzip\. - ^fmt\.Print.*$ - ^ioutil\..*$ - - ^os\.(DirEntry|FileInfo|FileMode|Is.*|Mode.*)$ + - ^os\.(DirEntry|ErrExist|ErrNotExist|FileInfo|FileMode|Is.*|Mode.*)$ gci: sections: - standard diff --git a/internal/cmd/mackupcmd_darwin.go b/internal/cmd/mackupcmd_darwin.go index f70914c58d6..d875a3f8290 100644 --- a/internal/cmd/mackupcmd_darwin.go +++ b/internal/cmd/mackupcmd_darwin.go @@ -7,8 +7,7 @@ import ( "bytes" "errors" "fmt" - "os" - "os/exec" + "io/fs" "path/filepath" "regexp" "strings" @@ -77,7 +76,7 @@ func (c *Config) runMackupAddCmd( for _, arg := range args { configRelPath := chezmoi.NewRelPath(arg + ".cfg") data, err := c.baseSystem.ReadFile(mackupDirAbsPath.Join(configRelPath)) - if errors.Is(err, os.ErrNotExist) { + if errors.Is(err, fs.ErrNotExist) { data, err = c.baseSystem.ReadFile(mackupApplicationsDir.Join(configRelPath)) } if err != nil { @@ -122,17 +121,17 @@ func (c *Config) runMackupAddCmd( } func (c *Config) mackupApplicationsDir() (chezmoi.AbsPath, error) { - mackupBinaryPath, err := exec.LookPath("mackup") + mackupBinaryPath, err := chezmoi.LookPath("mackup") if err != nil { - return chezmoi.EmptyAbsPath, fmt.Errorf("mackup binary not found in PATH (%w)", err) + return chezmoi.EmptyAbsPath, err } mackupBinaryPathResolved, err := filepath.EvalSymlinks(mackupBinaryPath) if err != nil { return chezmoi.EmptyAbsPath, err } - mackupBinaryPathAbs := chezmoi.NewAbsPath(mackupBinaryPathResolved) + mackupBinaryAbsPath := chezmoi.NewAbsPath(mackupBinaryPathResolved) - libDirAbsPath := mackupBinaryPathAbs.Dir().Dir().JoinString("lib") + libDirAbsPath := mackupBinaryAbsPath.Dir().Dir().JoinString("lib") dirEntries, err := c.baseSystem.ReadDir(libDirAbsPath) if err != nil { return chezmoi.EmptyAbsPath, err @@ -142,22 +141,13 @@ func (c *Config) mackupApplicationsDir() (chezmoi.AbsPath, error) { if !dirEntry.IsDir() || !strings.HasPrefix(dirEntry.Name(), "python") { continue } - - pythonDirRelPath := chezmoi.NewRelPath(dirEntry.Name()) - mackupAppsDir := libDirAbsPath.Join(pythonDirRelPath). - JoinString("site-packages", "mackup", "applications") - - if _, err := os.Stat(mackupAppsDir.String()); errors.Is(err, os.ErrNotExist) { - continue + mackupApplicationsDirAbsPath := libDirAbsPath.JoinString(dirEntry.Name(), "site-packages", "mackup", "applications") + if fileInfo, err := c.baseSystem.Stat(mackupApplicationsDirAbsPath); err == nil && fileInfo.IsDir() { + return mackupApplicationsDirAbsPath, nil } - - return mackupAppsDir, nil } - return chezmoi.EmptyAbsPath, fmt.Errorf( - "mackup python directory cannot be found: %s", - libDirAbsPath, - ) + return chezmoi.EmptyAbsPath, fmt.Errorf("%s: mackup application directory not found", libDirAbsPath) } func parseMackupApplication(data []byte) (mackupApplicationConfig, error) {
chore
Tidy up mackup code
ac6af02decf6035f86aa93744c62ff8c2789553d
2022-07-16 03:43:57
Craig Wilson
feat: Add support for AWS Secrets Manager
false
diff --git a/assets/chezmoi.io/docs/reference/configuration-file/variables.md b/assets/chezmoi.io/docs/reference/configuration-file/variables.md index 36428e7c0db..72eb279b66d 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md +++ b/assets/chezmoi.io/docs/reference/configuration-file/variables.md @@ -2,78 +2,81 @@ The following configuration variables are available: -| Section | Variable | Type | Default value | Description | -| -------------- | --------------------- | -------- | ------------------------ | ------------------------------------------------------ | -| Top level | `color` | string | `auto` | Colorize output | -| | `data` | any | *none* | Template data | -| | `destDir` | string | `~` | Destination directory | -| | `encryption` | string | *none* | Encryption tool, either `age` or `gpg` | -| | `format` | string | `json` | Format for data output, either `json` or `yaml` | -| | `mode` | string | `file` | Mode in target dir, either `file` or `symlink` | -| | `scriptTempDir` | string | *none* | Temporary directory for scripts |s -| | `sourceDir` | string | `~/.local/share/chezmoi` | Source directory | -| | `pager` | string | `$PAGER` | Default pager | -| | `umask` | int | *from system* | Umask | -| | `useBuiltinAge` | string | `auto` | Use builtin age if `age` command is not found in $PATH | -| | `useBuiltinGit` | string | `auto` | Use builtin git if `git` command is not found in $PATH | -| | `verbose` | bool | `false` | Make output more verbose | -| | `workingTree` | string | *source directory* | git working tree directory | -| `add` | `templateSymlinks` | bool | `false` | Template symlinks to source and home dirs | -| `age` | `args` | []string | *none* | Extra args to age CLI command | -| | `command` | string | `age` | age CLI command | -| | `identity` | string | *none* | age identity file | -| | `identities` | []string | *none* | age identity files | -| | `passphrase` | bool | `false` | Use age passphrase instead of identity | -| | `recipient` | string | *none* | age recipient | -| | `recipients` | []string | *none* | age recipients | -| | `recipientsFile` | []string | *none* | age recipients file | -| | `recipientsFiles` | []string | *none* | age recipients files | -| | `suffix` | string | `.age` | Suffix appended to age-encrypted files | -| | `symmetric` | bool | `false` | Use age symmetric encryption | -| `bitwarden` | `command` | string | `bw` | Bitwarden CLI command | -| `cd` | `args` | []string | *none* | Extra args to shell in `cd` command | -| | `command` | string | *none* | Shell to run in `cd` command | -| `completion` | `custom` | bool | `false` | Enable custom shell completions | -| `diff` | `args` | []string | *see `diff` below* | Extra args to external diff command | -| | `command` | string | *none* | External diff command | -| | `exclude` | []string | *none* | Entry types to exclude from diffs | -| | `pager` | string | *none* | Diff-specific pager | -| | `reverse` | bool | `false` | Reverse order of arguments to diff | -| `edit` | `args` | []string | *none* | Extra args to edit command | -| | `command` | string | `$EDITOR` / `$VISUAL` | Edit command | -| | `hardlink` | bool | `true` | Invoke editor with a hardlink to the source file | -| | `minDuration` | duration | `1s` | Minimum duration for edit command | -| `git` | `autoAdd ` | bool | `false` | Add changes to the source state after any change | -| | `autoCommit` | bool | `false` | Commit changes to the source state after any change | -| | `autoPush` | bool | `false` | Push changes to the source state after any change | -| | `command` | string | `git` | Source version control system | -| `gopass` | `command` | string | `gopass` | gopass CLI command | -| `gpg` | `args` | []string | *none* | Extra args to GPG CLI command | -| | `command` | string | `gpg` | GPG CLI command | -| | `recipient` | string | *none* | GPG recipient | -| | `recipients` | []string | *none* | GPG recipients | -| | `suffix` | string | `.asc` | Suffix appended to GPG-encrypted files | -| | `symmetric` | bool | `false` | Use symmetric GPG encryption | -| `interpreters` | *extension*`.args` | []string | *none* | See section on "Scripts on Windows" | -| | *extension*`.command` | string | *special* | See section on "Scripts on Windows" | -| `keepassxc` | `args` | []string | *none* | Extra args to KeePassXC CLI command | -| | `command` | string | `keepassxc-cli` | KeePassXC CLI command | -| | `database` | string | *none* | KeePassXC database | -| `keeper` | `args` | []string | *none* | Extra args to Keeper CLI command | -| | `command` | string | `keeper` | Keeper CLI command | -| `lastpass` | `command` | string | `lpass` | Lastpass CLI command | -| `merge` | `args` | []string | *see `merge` below* | Args to 3-way merge command | -| | `command` | string | `vimdiff` | 3-way merge command | -| `onepassword` | `cache` | bool | `true` | Enable optional caching provided by `op` | -| | `command` | string | `op` | 1Password CLI command | -| | `prompt` | bool | `true` | Prompt for sign-in when no valid session is available | -| `pass` | `command` | string | `pass` | Pass CLI command | -| `pinentry` | `args` | []string | *none* | Extra args to the pinentry command | -| | `command` | string | *none* | pinentry command | -| | `options` | []string | *see `pinentry` below* | Extra options for pinentry | -| `secret` | `command` | string | *none* | Generic secret command | -| `status` | `exclude` | []string | *none* | Entry types to exclude from status | -| `template` | `options` | []string | `["missingkey=error"]` | Template options | -| `textconv` | | []object | *none* | See section on "textconv" | -| `vault` | `command` | string | `vault` | Vault CLI command | -| `verify` | `exclude` | []string | *none* | Entry types to exclude from verify | +| Section | Variable | Type | Default value | Description | +|---------------------|-----------------------|----------|--------------------------|--------------------------------------------------------| +| Top level | `color` | string | `auto` | Colorize output | +| | `data` | any | *none* | Template data | +| | `destDir` | string | `~` | Destination directory | +| | `encryption` | string | *none* | Encryption tool, either `age` or `gpg` | +| | `format` | string | `json` | Format for data output, either `json` or `yaml` | +| | `mode` | string | `file` | Mode in target dir, either `file` or `symlink` | +| | `scriptTempDir` | string | *none* | Temporary directory for scripts | +| | `sourceDir` | string | `~/.local/share/chezmoi` | Source directory | +| | `pager` | string | `$PAGER` | Default pager | +| | `umask` | int | *from system* | Umask | +| | `useBuiltinAge` | string | `auto` | Use builtin age if `age` command is not found in $PATH | +| | `useBuiltinGit` | string | `auto` | Use builtin git if `git` command is not found in $PATH | +| | `verbose` | bool | `false` | Make output more verbose | +| | `workingTree` | string | *source directory* | git working tree directory | +| `add` | `templateSymlinks` | bool | `false` | Template symlinks to source and home dirs | +| `age` | `args` | []string | *none* | Extra args to age CLI command | +| | `command` | string | `age` | age CLI command | +| | `identity` | string | *none* | age identity file | +| | `identities` | []string | *none* | age identity files | +| | `passphrase` | bool | `false` | Use age passphrase instead of identity | +| | `recipient` | string | *none* | age recipient | +| | `recipients` | []string | *none* | age recipients | +| | `recipientsFile` | []string | *none* | age recipients file | +| | `recipientsFiles` | []string | *none* | age recipients files | +| | `suffix` | string | `.age` | Suffix appended to age-encrypted files | +| | `symmetric` | bool | `false` | Use age symmetric encryption | +| `awsSecretsManager` | `profile` | string | *none* | The AWS shared profile name | +| | `region` | string | *none* | The AWS region | +| `bitwarden` | `command` | string | `bw` | Bitwarden CLI command | +| `cd` | `args` | []string | *none* | Extra args to shell in `cd` command | +| | `command` | string | *none* | Shell to run in `cd` command | +| `completion` | `custom` | bool | `false` | Enable custom shell completions | +| `diff` | `args` | []string | *see `diff` below* | Extra args to external diff command | +| | `command` | string | *none* | External diff command | +| | `exclude` | []string | *none* | Entry types to exclude from diffs | +| | `pager` | string | *none* | Diff-specific pager | +| | `reverse` | bool | `false` | Reverse order of arguments to diff | +| `edit` | `args` | []string | *none* | Extra args to edit command | +| | `command` | string | `$EDITOR` / `$VISUAL` | Edit command | +| | `hardlink` | bool | `true` | Invoke editor with a hardlink to the source file | +| | `minDuration` | duration | `1s` | Minimum duration for edit command | +| `git` | `autoAdd ` | bool | `false` | Add changes to the source state after any change | +| | `autoCommit` | bool | `false` | Commit changes to the source state after any change | +| | `autoPush` | bool | `false` | Push changes to the source state after any change | +| | `command` | string | `git` | Source version control system | +| `gopass` | `command` | string | `gopass` | gopass CLI command | +| `gpg` | `args` | []string | *none* | Extra args to GPG CLI command | +| | `command` | string | `gpg` | GPG CLI command | +| | `recipient` | string | *none* | GPG recipient | +| | `recipients` | []string | *none* | GPG recipients | +| | `suffix` | string | `.asc` | Suffix appended to GPG-encrypted files | +| | `symmetric` | bool | `false` | Use symmetric GPG encryption | +| `interpreters` | *extension*`.args` | []string | *none* | See section on "Scripts on Windows" | +| | *extension*`.command` | string | *special* | See section on "Scripts on Windows" | +| `keepassxc` | `args` | []string | *none* | Extra args to KeePassXC CLI command | +| | `command` | string | `keepassxc-cli` | KeePassXC CLI command | +| | `database` | string | *none* | KeePassXC database | +| `keeper` | `args` | []string | *none* | Extra args to Keeper CLI command | +| | `command` | string | `keeper` | Keeper CLI command | +| `lastpass` | `command` | string | `lpass` | Lastpass CLI command | +| `merge` | `args` | []string | *see `merge` below* | Args to 3-way merge command | +| | `command` | string | `vimdiff` | 3-way merge command | +| `onepassword` | `cache` | bool | `true` | Enable optional caching provided by `op` | +| | `command` | string | `op` | 1Password CLI command | +| | `prompt` | bool | `true` | Prompt for sign-in when no valid session is available | +| `pass` | `command` | string | `pass` | Pass CLI command | +| `pinentry` | `args` | []string | *none* | Extra args to the pinentry command | +| | `command` | string | *none* | pinentry command | +| | `options` | []string | *see `pinentry` below* | Extra options for pinentry | +| `secret` | `command` | string | *none* | Generic secret command | +| `status` | `exclude` | []string | *none* | Entry types to exclude from status | +| `template` | `options` | []string | `["missingkey=error"]` | Template options | +| `textconv` | | []object | *none* | See section on "textconv" | +| `vault` | `command` | string | `vault` | Vault CLI command | +| `verify` | `exclude` | []string | *none* | Entry types to exclude from verify | + diff --git a/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManager.md b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManager.md new file mode 100644 index 00000000000..05b4bf4fc5f --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManager.md @@ -0,0 +1,8 @@ +# `awsSecretsManager` *arn* + +`awsSecretsManager` returns structured data retreived from +[AWS Secrets Manager](https://aws.amazon.com/secrets-manager/). *arn* specifies the `SecretId` passed to +[`GetSecretValue`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html). This can +either be the full ARN or the +[simpler name](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) +if applicable. diff --git a/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManagerRaw.md b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManagerRaw.md new file mode 100644 index 00000000000..8767cce69e4 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/awsSecretsManagerRaw.md @@ -0,0 +1,9 @@ +# `awsSecretsManagerRaw` *arn* + +`awsSecretsManager` returns the raw string value retrieved from +[AWS Secrets Manager](https://aws.amazon.com/secrets-manager/). *arn* specifies the `SecretId` passed to +[`GetSecretValue`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html). This can +either be the full ARN or the +[simpler name](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) +if applicable. + diff --git a/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/index.md b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/index.md new file mode 100644 index 00000000000..561b4655872 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/aws-secrets-manager-functions/index.md @@ -0,0 +1,8 @@ +# AWS Secrets Manager functions + +The `awsSecretsManager*` functions return data from [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) +using the [`GetSecretValue`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) +API. + +The profile and region are pulled from the standard environment variables and shared config files but can be +overridden by setting `awsSecretsManager.profile` and `awsSecretsManager.region` configuration variables respectively. diff --git a/assets/chezmoi.io/docs/user-guide/password-managers/aws-secrets-manager.md b/assets/chezmoi.io/docs/user-guide/password-managers/aws-secrets-manager.md new file mode 100644 index 00000000000..4877bf77c50 --- /dev/null +++ b/assets/chezmoi.io/docs/user-guide/password-managers/aws-secrets-manager.md @@ -0,0 +1,29 @@ +# AWS Secrets Manager + +chezmoi includes support for [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/). + +Structured data can be retrieved with the `awsSecretsManager` template function, for +example: + +``` +exampleUsername = {{ (awsSecretsManager "my-secret-name").username }} +examplePassword = {{ (awsSecretsManager "my-secret-name").password }} +``` + +For retrieving unstructured data, the `awsSecretsManagerRaw` template function can be used. +For example: + +``` +exampleSecretString = {{ awsSecretsManagerRaw "my-secret-string" }} +``` + +The AWS shared profile name and region can be specified in chezmoi's config file with +`awsSecretsManager.profile` and `awsSecretsManager.region` respectively. By default, these +values will be picked up from the standard environment variables and config files used +by the standard AWS tooling. + +```toml title="~/.config/chezmoi/chezmoi.toml" +[awsSecretsManager] + profile = myWorkProfile + region = us-east-2 +``` diff --git a/assets/chezmoi.io/docs/what-does-chezmoi-do.md b/assets/chezmoi.io/docs/what-does-chezmoi-do.md index 3de23f1d2bb..8af5fe681a5 100644 --- a/assets/chezmoi.io/docs/what-does-chezmoi-do.md +++ b/assets/chezmoi.io/docs/what-does-chezmoi-do.md @@ -42,11 +42,13 @@ FreeBSD, OpenBSD, and Termux. Nothing leaves your machine, unless you want it to. Your configuration remains in a git repo under your control. You can write the configuration file in the format of your choice. chezmoi can retrieve secrets from -[1Password](https://1password.com/), [Bitwarden](https://bitwarden.com/), -[gopass](https://www.gopass.pw/), [KeePassXC](https://keepassxc.org/), -[Keeper](https://www.keepersecurity.com/), [LastPass](https://lastpass.com/), -[pass](https://www.passwordstore.org/), [Vault](https://www.vaultproject.io/), -Keychain, [Keyring](https://wiki.gnome.org/Projects/GnomeKeyring), or any +[1Password](https://1password.com/), +[AWS Secrets Manager](https://aws.amazon.com/secrets-manager/), +[Bitwarden](https://bitwarden.com/), [gopass](https://www.gopass.pw/), +[KeePassXC](https://keepassxc.org/), [Keeper](https://www.keepersecurity.com/), +[LastPass](https://lastpass.com/), [pass](https://www.passwordstore.org/), +[Vault](https://www.vaultproject.io/), Keychain, +[Keyring](https://wiki.gnome.org/Projects/GnomeKeyring), or any command-line utility of your choice. You can encrypt individual files with [GnuPG](https://www.gnupg.org) or [age](https://age-encryption.org). You can checkout your dotfiles repo on as many machines as you want without revealing diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 5880bc8e0ae..73e166ff0c1 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -45,6 +45,7 @@ nav: - Password managers: - user-guide/password-managers/index.md - 1Password: user-guide/password-managers/1password.md + - AWS Secrets Manager: user-guide/password-managers/aws-secrets-manager.md - Bitwarden: user-guide/password-managers/bitwarden.md - gopass: user-guide/password-managers/gopass.md - KeePassXC: user-guide/password-managers/keepassxc.md @@ -183,6 +184,10 @@ nav: - onepasswordDocument: reference/templates/1password-functions/onepasswordDocument.md - onepasswordDetailsFields: reference/templates/1password-functions/onepasswordDetailsFields.md - onepasswordItemFields: reference/templates/1password-functions/onepasswordItemFields.md + - AWS Secrets Manager functions: + - reference/templates/aws-secrets-manager-functions/index.md + - awsSecretsManager: reference/templates/aws-secrets-manager-functions/awsSecretsManager.md + - awsSecretsManagerRaw: reference/templates/aws-secrets-manager-functions/awsSecretsManagerRaw.md - Bitwarden functions: - reference/templates/bitwarden-functions/index.md - bitwarden: reference/templates/bitwarden-functions/bitwarden.md diff --git a/go.mod b/go.mod index 60e6c90ca33..2c5e5f5bf92 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,9 @@ go 1.17 require ( filippo.io/age v1.0.0 github.com/Masterminds/sprig/v3 v3.2.2 + github.com/aws/aws-sdk-go-v2 v1.16.7 + github.com/aws/aws-sdk-go-v2/config v1.15.14 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.13 github.com/bmatcuk/doublestar/v4 v4.0.3 github.com/bradenhilton/mozillainstallhash v1.0.0 github.com/charmbracelet/glamour v0.5.0 @@ -49,6 +52,15 @@ require ( github.com/acomagu/bufpipe v1.0.3 // indirect github.com/alecthomas/chroma v0.10.0 // indirect github.com/alessio/shellescape v1.4.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.12 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.9 // indirect + github.com/aws/smithy-go v1.12.0 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradenhilton/cityhash v1.0.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect diff --git a/go.sum b/go.sum index af4a4f6b817..3dfc61f805b 100644 --- a/go.sum +++ b/go.sum @@ -28,7 +28,6 @@ cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+Y cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -36,43 +35,33 @@ cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNF cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.6.1 h1:8rBq3zRjnHx8UtBvaOWqBB1xq9jH6/wltfQLlTMh2Fw= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/age v1.0.0 h1:V6q14n0mqYU3qKFkZ6oOaF9oXneOviS3ubXsSVBRSzc= filippo.io/age v1.0.0/go.mod h1:PaX+Si/Sd5G8LgfCwldsSba3H1DDQZhIhFGkhbHaBq8= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -106,12 +95,35 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aws/aws-sdk-go-v2 v1.16.7 h1:zfBwXus3u14OszRxGcqCDS4MfMCv10e8SMJ2r8Xm0Ns= +github.com/aws/aws-sdk-go-v2 v1.16.7/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw= +github.com/aws/aws-sdk-go-v2/config v1.15.14 h1:+BqpqlydTq4c2et9Daury7gE+o67P4lbk7eybiCBNc4= +github.com/aws/aws-sdk-go-v2/config v1.15.14/go.mod h1:CQBv+VVv8rR5z2xE+Chdh5m+rFfsqeY4k0veEZeq6QM= +github.com/aws/aws-sdk-go-v2/credentials v1.12.9 h1:DloAJr0/jbvm0iVRFDFh8GlWxrOd9XKyX82U+dfVeZs= +github.com/aws/aws-sdk-go-v2/credentials v1.12.9/go.mod h1:2Vavxl1qqQXJ8MUcQZTsIEW8cwenFCWYXtLRPba3L/o= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8 h1:VfBdn2AxwMbFyJN/lF/xuT3SakomJ86PZu3rCxb5K0s= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.8/go.mod h1:oL1Q3KuCq1D4NykQnIvtRiBGLUXhcpY5pl6QZB2XEPU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14 h1:2C0pYHcUBmdzPj+EKNC4qj97oK6yjrUhc1KoSodglvk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.14/go.mod h1:kdjrMwHwrC3+FsKhNcCMJ7tUVj/8uSD5CZXeQ4wV6fM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8 h1:2J+jdlBJWEmTyAwC82Ym68xCykIvnSnIN18b8xHGlcc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.8/go.mod h1:ZIV8GYoC6WLBW5KGs+o4rsc65/ozd+eQ0L31XF5VDwk= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15 h1:QquxR7NH3ULBsKC+NoTpilzbKKS+5AELfNREInbhvas= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.15/go.mod h1:Tkrthp/0sNBShQQsamR7j/zY4p19tVTAs+nnqhH6R3c= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8 h1:oKnAXxSF2FUvfgw8uzU/v9OTYorJJZ8eBmWhr9TWVVQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.8/go.mod h1:rDVhIMAX9N2r8nWxDUlbubvvaFMnfsm+3jAV7q+rpM4= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.13 h1:9hFlfWKP1+u3js8IhRGf3M+S4MSoDK2v3bqIndGEpxU= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.13/go.mod h1:ByZbrzJwj5ScH6gvAlGslJK/LgJtPd0tteTBoG+yjVc= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.12 h1:760bUnTX/+d693FT6T6Oa7PZHfEQT9XMFZeM5IQIB0A= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.12/go.mod h1:MO4qguFjs3wPGcCSpQ7kOFTwRvb+eu+fn+1vKleGHUk= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.9 h1:yOfILxyjmtr2ubRkRJldlHDFBhf5vw4CzhbwWIBmimQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.9/go.mod h1:O1IvkYxr+39hRf960Us6j0x1P8pDqhTX+oXM5kQNl/Y= +github.com/aws/smithy-go v1.12.0 h1:gXpeZel/jPoWQ7OEmLIgCUnhkFftqNfwWUwAHSlp1v0= +github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -124,25 +136,19 @@ github.com/bradenhilton/cityhash v1.0.0 h1:1QauDCwfxwIGwO2jBTJdEBqXgfCusAgQOSgdl github.com/bradenhilton/cityhash v1.0.0/go.mod h1:Wmb8yW1egA9ulrsRX4mxfYx5zq4nBWOCZ+j63oK6uz8= github.com/bradenhilton/mozillainstallhash v1.0.0 h1:QL9byVGb4FrVOI7MubnME3uPNj5R78tqYQPlxuBmXMw= github.com/bradenhilton/mozillainstallhash v1.0.0/go.mod h1:yVD0OX1izZHYl1lBm2UDojyE/k0xIqKJK78k+tdWV+k= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/glamour v0.5.0 h1:wu15ykPdB7X6chxugG/NNfDUbyyrCLV9XBalj5wdu3g= github.com/charmbracelet/glamour v0.5.0/go.mod h1:9ZRtG19AUIzcTm7FGLGbq3D5WKQ5UyZBbQsMQN0XIqc= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -153,12 +159,9 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -176,19 +179,15 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -207,10 +206,8 @@ github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2Su github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -218,7 +215,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -226,14 +222,11 @@ github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -290,10 +283,8 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gops v0.3.25 h1:Pf6uw+cO6pDhc7HJ71NiG0x8dyQTeQcmg3HQFF39qVw= github.com/google/gops v0.3.25/go.mod h1:8A7ebAm0id9K3H0uOggeRVGxszSvnlURun9mg3GdYDw= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -305,7 +296,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2 h1:LR89qFljJ48s990kEKGsk213yIJDPI4205OKOzbURK8= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -328,10 +318,8 @@ github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pf github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= @@ -339,25 +327,20 @@ github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJr github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -365,7 +348,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -373,13 +355,11 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -390,32 +370,27 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 h1:WjT3fLi9n8YWh/Ih8Q1LHAPsTqGddPcHqscN+PJ3i68= github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -423,14 +398,12 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= @@ -476,11 +449,9 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/muesli/combinator v0.3.0 h1:SZDuRzzwmVPLkbOzbhGzBTwd5+Y6aFN4UusOW2azrNA= github.com/muesli/combinator v0.3.0/go.mod h1:ttPegJX0DPQaGDtJKMInIP6Vfp5pN8RX7QntFCcpy18= @@ -491,7 +462,6 @@ github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -510,13 +480,11 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -525,7 +493,6 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -545,20 +512,16 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.26.0/go.mod h1:yBiM87lvSqX8h0Ww4sdzNSkVYZ8dL2xjZJG1lAuGZEo= github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.6.0 h1:REOEXCs/NFY/1jOCEouMuT4zEniE5YoXbvpC5X/TLF8= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil/v3 v3.22.4 h1:srAQaiX6jX/cYL6q29aE0m8lOskT9CurZ9N61YR3yoI= github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= @@ -567,7 +530,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -600,9 +562,7 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twpayne/go-pinentry v0.2.0 h1:hS5NEJiilop9xP9pBX/1NYduzDlGGMdg1KamTBTrOWw= @@ -620,7 +580,6 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xanzy/ssh-agent v0.3.1 h1:AmzO1SSWxw73zxFZPRwaMN1MohDw8UyHnmuxyceTEGo= github.com/xanzy/ssh-agent v0.3.1/go.mod h1:QIE4lCeL7nkC25x+yA3LBIYfwCc1TFziCtG7cBAac6w= -github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -633,19 +592,14 @@ github.com/yuin/goldmark v1.4.12 h1:6hffw6vALvEDqJ19dOJvJKOoAOKe4NDaTqvd2sktGN0= github.com/yuin/goldmark v1.4.12/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zalando/go-keyring v0.2.1 h1:MBRN/Z8H4U5wEKXiD67YbDAr5cj/DOStmSga70/2qKc= github.com/zalando/go-keyring v0.2.1/go.mod h1:g63M2PPn0w5vjmEbwAX3ib5I+41zdm4esSETOn9Y6Dw= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.4 h1:Dcx3/MYyfKcPNLpR4VVQUP5KgYrBeJtktBwEKkw08Ao= go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -653,7 +607,6 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -663,7 +616,6 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -691,10 +643,8 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -706,11 +656,9 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= @@ -719,7 +667,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -921,7 +868,6 @@ golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -972,7 +918,6 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -985,7 +930,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1027,7 +971,6 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.81.0 h1:o8WF5AvfidafWbFjsRyupxyEQJNUWxLZJCK5NXrxZZ8= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -1117,7 +1060,6 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= @@ -1151,7 +1093,6 @@ google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -1184,7 +1125,6 @@ gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1206,20 +1146,14 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= -mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE= mvdan.cc/editorconfig v0.2.0/go.mod h1:lvnnD3BNdBYkhq+B4uBuFFKatfp02eB6HixDvEz91C0= mvdan.cc/sh/v3 v3.5.1 h1:hmP3UOw4f+EYexsJjFxvU38+kn+V/s2CclXHanIBkmQ= mvdan.cc/sh/v3 v3.5.1/go.mod h1:1JcoyAKm1lZw/2bZje/iYKWicU/KMd0rsyJeKHnsK4E= -rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/goversion v1.2.0 h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w= rsc.io/goversion v1.2.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo= -rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/cmd/awssecretsmanagertemplatefuncs.go b/pkg/cmd/awssecretsmanagertemplatefuncs.go new file mode 100644 index 00000000000..a11e29e1a38 --- /dev/null +++ b/pkg/cmd/awssecretsmanagertemplatefuncs.go @@ -0,0 +1,92 @@ +package cmd + +import ( + "context" + "encoding/base64" + "encoding/json" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager" +) + +type awsSecretsManagerConfig struct { + Region string + Profile string + + svc *secretsmanager.Client + cache map[string]string + jsonCache map[string]map[string]interface{} +} + +func (c *Config) awsSecretsManagerRawTemplateFunc(arn string) string { + if secret, ok := c.AWSSecretsManager.cache[arn]; ok { + return secret + } + + if c.AWSSecretsManager.svc == nil { + var opts []func(*config.LoadOptions) error + if region := c.AWSSecretsManager.Region; len(region) > 0 { + opts = append(opts, config.WithRegion(region)) + } + if profile := c.AWSSecretsManager.Profile; len(profile) > 0 { + opts = append(opts, config.WithSharedConfigProfile(profile)) + } + + opts = append(opts, config.WithRetryMaxAttempts(1)) + + cfg, err := config.LoadDefaultConfig(context.Background(), opts...) + if err != nil { + panic(err) + } + + c.AWSSecretsManager.svc = secretsmanager.NewFromConfig(cfg) + } + + result, err := c.AWSSecretsManager.svc.GetSecretValue(context.Background(), &secretsmanager.GetSecretValueInput{ + SecretId: aws.String(arn), + }) + if err != nil { + panic(err) + } + + var secret string + if result.SecretString != nil { + secret = *result.SecretString + } else { + decodedBinarySecretBytes := make([]byte, base64.StdEncoding.DecodedLen(len(result.SecretBinary))) + length, err := base64.StdEncoding.Decode(decodedBinarySecretBytes, result.SecretBinary) + if err != nil { + panic(err) + } + + secret = string(decodedBinarySecretBytes[:length]) + } + + if c.AWSSecretsManager.cache == nil { + c.AWSSecretsManager.cache = make(map[string]string) + } + + c.AWSSecretsManager.cache[arn] = secret + return secret +} + +func (c *Config) awsSecretsManagerTemplateFunc(arn string) map[string]interface{} { + if secret, ok := c.AWSSecretsManager.jsonCache[arn]; ok { + return secret + } + + raw := c.awsSecretsManagerRawTemplateFunc(arn) + + var data map[string]interface{} + if err := json.Unmarshal([]byte(raw), &data); err != nil { + panic(err) + } + + if c.AWSSecretsManager.jsonCache == nil { + c.AWSSecretsManager.jsonCache = make(map[string]map[string]interface{}) + } + + c.AWSSecretsManager.jsonCache[arn] = data + return data +} diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index ebffe92da8b..232ec050e78 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -91,15 +91,16 @@ type ConfigFile struct { WorkingTreeAbsPath chezmoi.AbsPath `mapstructure:"workingTree"` // Password manager configurations. - Bitwarden bitwardenConfig `mapstructure:"bitwarden"` - Gopass gopassConfig `mapstructure:"gopass"` - Keepassxc keepassxcConfig `mapstructure:"keepassxc"` - Keeper keeperConfig `mapstructure:"keeper"` - Lastpass lastpassConfig `mapstructure:"lastpass"` - Onepassword onepasswordConfig `mapstructure:"onepassword"` - Pass passConfig `mapstructure:"pass"` - Secret secretConfig `mapstructure:"secret"` - Vault vaultConfig `mapstructure:"vault"` + AWSSecretsManager awsSecretsManagerConfig `mapstructure:"awsSecretsManager"` + Bitwarden bitwardenConfig `mapstructure:"bitwarden"` + Gopass gopassConfig `mapstructure:"gopass"` + Keepassxc keepassxcConfig `mapstructure:"keepassxc"` + Keeper keeperConfig `mapstructure:"keeper"` + Lastpass lastpassConfig `mapstructure:"lastpass"` + Onepassword onepasswordConfig `mapstructure:"onepassword"` + Pass passConfig `mapstructure:"pass"` + Secret secretConfig `mapstructure:"secret"` + Vault vaultConfig `mapstructure:"vault"` // Encryption configurations. Encryption string `json:"encryption" mapstructure:"encryption"` @@ -428,6 +429,8 @@ func newConfig(options ...configOption) (*Config, error) { } for key, value := range map[string]interface{}{ + "awsSecretsManager": c.awsSecretsManagerTemplateFunc, + "awsSecretsManagerRaw": c.awsSecretsManagerRawTemplateFunc, "bitwarden": c.bitwardenTemplateFunc, "bitwardenAttachment": c.bitwardenAttachmentTemplateFunc, "bitwardenFields": c.bitwardenFieldsTemplateFunc,
feat
Add support for AWS Secrets Manager
4a448f147d04c2725e52c238b01617053950f30b
2022-12-30 00:15:13
Tom Payne
chore: Special case file:// URLs
false
diff --git a/pkg/cmd/initcmd.go b/pkg/cmd/initcmd.go index 4cc212eb075..47625d55128 100644 --- a/pkg/cmd/initcmd.go +++ b/pkg/cmd/initcmd.go @@ -8,6 +8,7 @@ import ( "regexp" "runtime" "strconv" + "strings" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -198,15 +199,18 @@ func (c *Config) runInitCmd(cmd *cobra.Command, args []string) error { "--depth", strconv.Itoa(c.init.depth), ) } - repoURL, err := url.Parse(repoURLStr) - if err != nil { - return err - } - if repoURL.User == nil { - repoURL.User = url.User(username) + if !strings.HasPrefix(repoURLStr, "file://") { + repoURL, err := url.Parse(repoURLStr) + if err != nil { + return err + } + if repoURL.User == nil { + repoURL.User = url.User(username) + repoURLStr = repoURL.String() + } } args = append(args, - repoURL.String(), + repoURLStr, workingTreeRawPath.String(), ) if err := c.run(chezmoi.EmptyAbsPath, c.Git.Command, args); err != nil {
chore
Special case file:// URLs
a49a7e0d4da20dabe3a2103f69302a267631a710
2024-04-30 03:04:04
Tom Payne
chore: Disable buggy ireturn linter
false
diff --git a/.golangci.yml b/.golangci.yml index 8c43a140557..dd72444b897 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,7 +39,6 @@ linters: - inamedparam - ineffassign - interfacebloat - - ireturn - loggercheck - makezero - mirror @@ -95,6 +94,7 @@ linters: - goheader - gomnd - gomoddirectives + - ireturn - lll - maintidx - maligned @@ -134,27 +134,6 @@ linters-settings: - fieldalignment - shadow enable-all: true - ireturn: - allow: - - anon - - comparable - - empty - - error - - github\.com/charmbracelet/bubbletea\.Model - - github\.com/charmbracelet/bubbletea\.Msg - - github\.com/go-git/go-git/v5/plumbing/format/diff\.File - - github\.com/go-git/go-git/v5/plumbing/format/diff\.Patch - - github\.com/mitchellh/mapstructure\.DecodeHookFunc - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.ActualStateEntry - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.Encryption - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.Format - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.PersistentState - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.SourceStateOrigin - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.SourceStateEntry - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.System - - github\.com/twpayne/chezmoi/v2/internal/chezmoi\.TargetStateEntry - - github\.com/twpayne/go-vfs/v5\.FS - - stdlib misspell: locale: US stylecheck: diff --git a/internal/chezmoibubbles/chezmoibubbles_test.go b/internal/chezmoibubbles/chezmoibubbles_test.go index 079d36fb59f..56558c28d47 100644 --- a/internal/chezmoibubbles/chezmoibubbles_test.go +++ b/internal/chezmoibubbles/chezmoibubbles_test.go @@ -15,7 +15,7 @@ var keyTypes = chezmoiset.New( tea.KeyEsc, ) -func makeKeyMsg(r rune) tea.Msg { //nolint:ireturn,nolintlint +func makeKeyMsg(r rune) tea.Msg { key := tea.Key{ Type: tea.KeyRunes, Runes: []rune{r}, @@ -28,7 +28,7 @@ func makeKeyMsg(r rune) tea.Msg { //nolint:ireturn,nolintlint return tea.KeyMsg(key) } -func makeKeyMsgs(s string) []tea.Msg { //nolint:ireturn,nolintlint +func makeKeyMsgs(s string) []tea.Msg { msgs := make([]tea.Msg, 0, len(s)) for _, r := range s { msgs = append(msgs, makeKeyMsg(r)) @@ -36,11 +36,7 @@ func makeKeyMsgs(s string) []tea.Msg { //nolint:ireturn,nolintlint return msgs } -func testRunModelWithInput[M tea.Model]( //nolint:ireturn,nolintlint - t *testing.T, - model M, - input string, -) M { +func testRunModelWithInput[M tea.Model](t *testing.T, model M, input string) M { t.Helper() for _, msg := range makeKeyMsgs(input) { m, _ := model.Update(msg) diff --git a/internal/chezmoiset/chezmoiset.go b/internal/chezmoiset/chezmoiset.go index 867ed616ce2..d67fee49f33 100644 --- a/internal/chezmoiset/chezmoiset.go +++ b/internal/chezmoiset/chezmoiset.go @@ -32,7 +32,7 @@ func (s Set[T]) AddSet(other Set[T]) { // AnyElement returns an arbitrary element from s. It is typically used when s // is known to contain exactly one element. -func (s Set[T]) AnyElement() T { //nolint:ireturn +func (s Set[T]) AnyElement() T { for element := range s { return element } diff --git a/internal/cmd/prompt.go b/internal/cmd/prompt.go index c78c5abc307..cb767408686 100644 --- a/internal/cmd/prompt.go +++ b/internal/cmd/prompt.go @@ -241,7 +241,7 @@ type cancelableModel interface { Canceled() bool } -func runCancelableModel[M cancelableModel](initModel M) (M, error) { //nolint:ireturn,nolintlint +func runCancelableModel[M cancelableModel](initModel M) (M, error) { switch finalModel, err := runModel(initModel); { case err != nil: return finalModel, err @@ -252,7 +252,7 @@ func runCancelableModel[M cancelableModel](initModel M) (M, error) { //nolint:ir } } -func runModel[M tea.Model](initModel M) (M, error) { //nolint:ireturn,nolintlint +func runModel[M tea.Model](initModel M) (M, error) { program := tea.NewProgram(initModel) finalModel, err := program.Run() return finalModel.(M), err //nolint:forcetypeassert
chore
Disable buggy ireturn linter
b5b8095619841c67323dd2874c119d6a0801d09b
2025-02-13 22:04:05
Tom Payne
chore: Run jobs on oldest supported Ubuntu
false
diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index a0c07352223..60d00732f9e 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -50,7 +50,7 @@ jobs: matrix: os: - macos-13 - - ubuntu-20.04 + - ubuntu-22.04 #- windows-2022 # fails with "debug http_download_curl received HTTP status 000" needs: changes runs-on: ${{ matrix.os }} @@ -76,7 +76,7 @@ jobs: matrix: os: - macos-13 - - ubuntu-20.04 + - ubuntu-22.04 - windows-2022 needs: changes runs-on: ${{ matrix.os }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 803f3c8090f..0da752cd91d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -211,7 +211,7 @@ jobs: go test ./... test-release: needs: changes - runs-on: ubuntu-20.04 # use older Ubuntu for older glibc + runs-on: ubuntu-22.04 # use older Ubuntu for older glibc permissions: contents: read steps: @@ -473,7 +473,7 @@ jobs: - test-ubuntu - test-website - test-windows - runs-on: ubuntu-20.04 # use older Ubuntu for older glibc + runs-on: ubuntu-22.04 # use older Ubuntu for older glibc permissions: contents: write steps:
chore
Run jobs on oldest supported Ubuntu
4572931648e3a16779e7be700b7ae5f76352d71e
2021-11-29 19:57:37
Tom Payne
chore: Add --no-cache when installing packages in Alpine
false
diff --git a/assets/docker/alpine.Dockerfile b/assets/docker/alpine.Dockerfile index b765dff4544..d1778abd5e1 100644 --- a/assets/docker/alpine.Dockerfile +++ b/assets/docker/alpine.Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk add age git go unzip zip +RUN apk --no-cache add age git go unzip zip ENTRYPOINT ( cd /chezmoi && go test ./... )
chore
Add --no-cache when installing packages in Alpine
f4f46e3ad86e3c48576096d07da0d5962e33a716
2023-07-30 04:49:41
Tom Payne
fix: Make detection of mackup config dir more robust
false
diff --git a/pkg/cmd/mackupcmd_darwin.go b/pkg/cmd/mackupcmd_darwin.go index 221e6d54e33..b4103d2fb26 100644 --- a/pkg/cmd/mackupcmd_darwin.go +++ b/pkg/cmd/mackupcmd_darwin.go @@ -16,11 +16,10 @@ import ( ) var ( - mackupCommentRx = regexp.MustCompile(`\A#.*\z`) - mackupKeyValueRx = regexp.MustCompile(`\A(\w+)\s*=\s*(.*)\z`) - mackupSectionRx = regexp.MustCompile(`\A\[(.*)\]\z`) - mackupVersionRx = regexp.MustCompile(`\AMackup\s+(\d+\.\d+\.\d+)\s*\z`) - pythonMajorMinorVersionRx = regexp.MustCompile(`\APython\s+(\d+\.\d+)\.\d+\s*\z`) + mackupCommentRx = regexp.MustCompile(`\A#.*\z`) + mackupKeyValueRx = regexp.MustCompile(`\A(\w+)\s*=\s*(.*)\z`) + mackupSectionRx = regexp.MustCompile(`\A\[(.*)\]\z`) + mackupVersionRx = regexp.MustCompile(`\AMackup\s+(\d+\.\d+\.\d+)\s*\z`) ) type mackupApplicationApplicationConfig struct { @@ -139,31 +138,28 @@ func (c *Config) mackupApplicationsDir() (chezmoi.AbsPath, error) { } mackupVersion := string(mackupVersionMatch[1]) - pythonVersionCmd := exec.Command("python3", "--version") - pythonVersionData, err := pythonVersionCmd.Output() + libDirAbsPath := brewPrefix.JoinString("Cellar", "mackup", mackupVersion, "libexec", "lib") + dirEntries, err := c.baseSystem.ReadDir(libDirAbsPath) if err != nil { return chezmoi.EmptyAbsPath, err } - pythonMajorMinorVersionMatch := pythonMajorMinorVersionRx.FindSubmatch(pythonVersionData) - if pythonMajorMinorVersionMatch == nil { + var pythonDirRelPath chezmoi.RelPath + for _, dirEntry := range dirEntries { + if dirEntry.IsDir() && strings.HasPrefix(dirEntry.Name(), "python") { + pythonDirRelPath = chezmoi.NewRelPath(dirEntry.Name()) + break + } + } + if pythonDirRelPath.Empty() { return chezmoi.EmptyAbsPath, fmt.Errorf( - "%q: cannot determine Python version", - pythonVersionData, + "%s: could not find python directory", + libDirAbsPath, ) } - pythonMajorMinorVersion := string(pythonMajorMinorVersionMatch[1]) - - return brewPrefix.JoinString( - "Cellar", - "mackup", - mackupVersion, - "libexec", - "lib", - "python"+pythonMajorMinorVersion, - "site-packages", - "mackup", - "applications", - ), nil + + return libDirAbsPath.Join(pythonDirRelPath). + JoinString("site-packages", "mackup", "applications"), + nil } func parseMackupApplication(data []byte) (mackupApplicationConfig, error) { diff --git a/pkg/cmd/testdata/scripts/mackup_darwin.txt b/pkg/cmd/testdata/scripts/mackup_darwin.txt index c9579db1959..54fb6f927b2 100644 --- a/pkg/cmd/testdata/scripts/mackup_darwin.txt +++ b/pkg/cmd/testdata/scripts/mackup_darwin.txt @@ -2,13 +2,12 @@ chmod 755 bin/brew chmod 755 bin/mackup -chmod 755 bin/python3 # test that chezmoi mackup add adds normal dotfiles exec chezmoi mackup add curl cmp $CHEZMOISOURCEDIR/dot_curlrc golden/dot_curlrc -# test that chezmoi +# test that chezmoi mackup add adds XDG configuration files exec chezmoi mackup add vscode cmp $CHEZMOISOURCEDIR/dot_config/Code/User/settings.json golden/settings.json @@ -34,17 +33,6 @@ case "$*" in echo "Usage:" ;; esac --- bin/python3 -- -#!/bin/sh - -case "$*" in -"--version") - echo "Python 3.9.0" - ;; -*) - echo "Usage:" - ;; -esac -- golden/dot_curlrc -- # contents of .curlrc -- golden/settings.json --
fix
Make detection of mackup config dir more robust
3e2616538a6c80800c14b1039a2afe4040b558da
2021-11-03 04:40:15
Tom Payne
chore: Separate out build and build-all targets
false
diff --git a/Makefile b/Makefile index d1089489a47..a1d4a687412 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GO?=go GOLANGCI_LINT_VERSION=$(shell grep GOLANGCI_LINT_VERSION: .github/workflows/main.yml | awk '{ print $$2 }') .PHONY: default -default: run build test lint format +default: run build-all test lint format .PHONY: install install: @@ -12,7 +12,14 @@ install: -X main.builtBy=source" .PHONY: build -build: build-darwin build-freebsd build-linux build-windows +build: + go build -ldflags "-X main.version=$(shell git describe --abbrev=0 --tags) \ + -X main.commit=$(shell git rev-parse HEAD) \ + -X main.date=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) \ + -X main.builtBy=source" + +.PHONY: build-all +build-all: build-darwin build-freebsd build-linux build-windows .PHONY: build-darwin build-darwin:
chore
Separate out build and build-all targets
bde9ae7497b37441167dfbc170b71bde116a1e0f
2025-01-01 23:03:00
Tom Payne
chore: Add commit message lint exception for Dependabot
false
diff --git a/internal/cmds/lint-commit-messages/main.go b/internal/cmds/lint-commit-messages/main.go index bdcac1f3845..c0d6c521be7 100644 --- a/internal/cmds/lint-commit-messages/main.go +++ b/internal/cmds/lint-commit-messages/main.go @@ -10,7 +10,7 @@ import ( "strings" ) -var commitRx = regexp.MustCompile(`\A([0-9a-f]{40}) (chore(?:\([\w\-]+\))?|docs|feat|fix): [A-Z]`) +var commitRx = regexp.MustCompile(`\A([0-9a-f]{40}) (chore(?:\([\w\-]+\))?|docs|feat|fix): ([A-Z]|bump)`) func run() error { args := append([]string{"log", "--format=oneline"}, os.Args[1:]...) diff --git a/internal/cmds/lint-commit-messages/main_test.go b/internal/cmds/lint-commit-messages/main_test.go index abd4fb4208b..de8964c3b6f 100644 --- a/internal/cmds/lint-commit-messages/main_test.go +++ b/internal/cmds/lint-commit-messages/main_test.go @@ -12,6 +12,7 @@ func TestCommitRx(t *testing.T) { for s, match := range map[string]bool{ "chore(deps): Text": true, "chore(deps-dev): Text": true, + "chore(deps): bump": true, "chore: Text": true, "docs: Text": true, "feat: Text": true,
chore
Add commit message lint exception for Dependabot
2bcc921e2e6e498624f48a44ce086b6977d02e14
2023-11-20 07:10:00
dependabot[bot]
chore(deps): bump github/codeql-action from 2.22.5 to 2.22.7
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30a03692850..97fa25e0c4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,10 +51,10 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: fetch-depth: 1 - - uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 + - uses: github/codeql-action/init@66b90a5db151a8042fa97405c6cf843bbe433f7b with: languages: go - - uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 + - uses: github/codeql-action/analyze@66b90a5db151a8042fa97405c6cf843bbe433f7b misspell: runs-on: ubuntu-22.04 steps:
chore
bump github/codeql-action from 2.22.5 to 2.22.7
d28823de7fb5edbc71e93c90357d2d228c1b8dbb
2024-10-11 22:03:39
Ruslan Sayfutdinov
fix: Use builtin age when encryption is unset
false
diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 07d933b8dcd..d5e6f371379 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -2466,11 +2466,6 @@ func (c *Config) runHookPre(hook string) error { func (c *Config) setEncryption() error { switch c.Encryption { case "age": - // Only use builtin age encryption if age encryption is explicitly - // specified. Otherwise, chezmoi would fall back to using age encryption - // (rather than no encryption) if age is not in $PATH, which leads to - // error messages from the builtin age instead of error messages about - // encryption not being configured. c.Age.UseBuiltin = c.UseBuiltinAge.Value(c.useBuiltinAgeAutoFunc) c.encryption = &c.Age case "gpg": @@ -2480,8 +2475,17 @@ func (c *Config) setEncryption() error { // gpg for backwards compatibility. switch { case !reflect.DeepEqual(c.GPG, defaultGPGEncryptionConfig): + c.errorf( + "warning: 'encryption' not set, using gpg configuration. " + + "Check if 'encryption' is correctly set as the top-level key.\n", + ) c.encryption = &c.GPG case !reflect.DeepEqual(c.Age, defaultAgeEncryptionConfig): + c.errorf( + "warning: 'encryption' not set, using age configuration. " + + "Check if 'encryption' is correctly set as the top-level key.\n", + ) + c.Age.UseBuiltin = c.UseBuiltinAge.Value(c.useBuiltinAgeAutoFunc) c.encryption = &c.Age default: c.encryption = chezmoi.NoEncryption{} @@ -2511,7 +2515,7 @@ func (c *Config) setEnvironmentVariables() error { } for key, value := range env { if strings.HasPrefix(key, "CHEZMOI_") { - c.errorf("warning: %s: overriding reserved environment variable", key) + c.errorf("warning: %s: overriding reserved environment variable\n", key) } if err := os.Setenv(key, value); err != nil { return err diff --git a/internal/cmd/config_test.go b/internal/cmd/config_test.go index 098ee3f2134..3b3ac722fe8 100644 --- a/internal/cmd/config_test.go +++ b/internal/cmd/config_test.go @@ -1,6 +1,7 @@ package cmd import ( + "bytes" "fmt" "io" "io/fs" @@ -303,6 +304,178 @@ func TestUpperSnakeCaseToCamelCase(t *testing.T) { } } +func TestIssue3980(t *testing.T) { + tests := []struct { + name string + filename string + contents string + expectsErr bool + warns []string + expectedEncryptionType interface{} + usesBuiltinAge bool + }{ + { + name: "empty_config", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "", + ), + expectsErr: false, + warns: nil, + expectedEncryptionType: chezmoi.NoEncryption{}, + usesBuiltinAge: false, + }, + { + name: "empty_encryption_no_configs", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "encryption = \"\"", + ), + expectsErr: false, + warns: nil, + expectedEncryptionType: chezmoi.NoEncryption{}, + usesBuiltinAge: false, + }, + { + name: "valid_age_config", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "encryption = \"age\"", + "[age]", + "command = \"fakeage\"", + "identity = \"key.txt\"", + ), + expectsErr: false, + warns: nil, + expectedEncryptionType: &chezmoi.AgeEncryption{}, + usesBuiltinAge: true, + }, + { + name: "valid_age_config_no_builtin", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "encryption = \"age\"", + "useBuiltinAge = \"off\"", + "[age]", + "command = \"fakeage\"", + "identity = \"key.txt\"", + ), + expectsErr: false, + warns: nil, + expectedEncryptionType: &chezmoi.AgeEncryption{}, + usesBuiltinAge: false, + }, + { + name: "valid_gpg_config", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "encryption = \"gpg\"", + "[gpg]", + "command = \"fakegpg\"", + "symmetric = true", + ), + expectsErr: false, + warns: nil, + expectedEncryptionType: &chezmoi.GPGEncryption{}, + usesBuiltinAge: false, + }, + { + name: "unset_encryption_uses_gpg", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "[gpg]", + "command = \"fakegpg\"", + "symmetric = true", + ), + expectsErr: false, + warns: []string{"warning: 'encryption' not set, using gpg configuration"}, + expectedEncryptionType: &chezmoi.GPGEncryption{}, + usesBuiltinAge: false, + }, + { + name: "unset_encryption_uses_age", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "[age]", + "command = \"fakeage\"", + "identity = \"key.txt\"", + ), + expectsErr: false, + warns: []string{"warning: 'encryption' not set, using age configuration"}, + expectedEncryptionType: &chezmoi.AgeEncryption{}, + usesBuiltinAge: true, + }, + { + name: "unset_encryption_uses_age_no_builtin", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "useBuiltinAge = \"off\"", + "[age]", + "command = \"fakeage\"", + "identity = \"key.txt\"", + ), + expectsErr: false, + warns: []string{"warning: 'encryption' not set, using age configuration"}, + expectedEncryptionType: &chezmoi.AgeEncryption{}, + usesBuiltinAge: false, + }, + { + name: "unset_encryption_gpg_priority", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "[age]", + "command = \"fakeage\"", + "identity = \"key.txt\"", + "[gpg]", + "command = \"fakegpg\"", + "symmetric = true", + ), + expectsErr: false, + warns: []string{"warning: 'encryption' not set, using gpg configuration"}, + expectedEncryptionType: &chezmoi.GPGEncryption{}, + usesBuiltinAge: false, + }, + { + name: "unknown_encryption", + filename: "chezmoi.toml", + contents: chezmoitest.JoinLines( + "encryption = \"unknown\"", + ), + expectsErr: true, + warns: nil, + usesBuiltinAge: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + chezmoitest.WithTestFS(t, map[string]any{ + "/home/user/.config/chezmoi/" + tt.filename: tt.contents, + }, func(fileSystem vfs.FS) { + c := newTestConfig(t, fileSystem) + + // Create a buffer to capture stderr. + var stderr bytes.Buffer + c.stderr = &stderr + + err := c.execute([]string{"init"}) + + if tt.expectsErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + assert.Equal(t, reflect.TypeOf(tt.expectedEncryptionType), reflect.TypeOf(c.encryption)) + assert.Equal(t, tt.usesBuiltinAge, c.Age.UseBuiltin) + + for _, warn := range tt.warns { + assert.Contains(t, stderr.String(), warn) + } + }) + }) + } +} + func newTestConfig(t *testing.T, fileSystem vfs.FS, options ...configOption) *Config { t.Helper() system := chezmoi.NewRealSystem(fileSystem)
fix
Use builtin age when encryption is unset
f04f9f975308d74677df393b9a7254316331586d
2025-03-20 05:10:08
Tom Payne
chore: Use standard regexp package for gitleaks
false
diff --git a/go.mod b/go.mod index 218ee984072..e8541ee79fe 100644 --- a/go.mod +++ b/go.mod @@ -182,3 +182,9 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +// Use a fork of gitleaks that uses the standard regexp package, not +// github.com/wasilibs/go-re2. This improves startup time, and avoids linking in a +// full WASM runtime. +// See https://github.com/gitleaks/gitleaks/issues/1796. +replace github.com/zricethezav/gitleaks/v8 => github.com/twpayne/gitleaks/v8 v8.0.0-20250319121243-993bde9542cc diff --git a/go.sum b/go.sum index 02874778416..f84dc918bfe 100644 --- a/go.sum +++ b/go.sum @@ -314,8 +314,8 @@ github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb h1:w1g9wNDIE/pHS github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc= github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/makiuchi-d/gozxing v0.1.1 h1:xxqijhoedi+/lZlhINteGbywIrewVdVv2wl9r5O9S1I= github.com/makiuchi-d/gozxing v0.1.1/go.mod h1:eRIHbOjX7QWxLIDJoQuMLhuXg9LAuw6znsUtRkNw9DU= github.com/martinhoefling/goxkcdpwgen v0.1.2-0.20231122080842-e51aa57005ca h1:jV6vw7U2RoS1sI7f6f12/wsCwMjADZ/xUxi/lhUqjV8= @@ -366,8 +366,6 @@ github.com/noborus/ov v0.37.0 h1:I8+5OmV+yC71OrDtY1dfO2UmZrSQ7ERDTSo6M2Gbie0= github.com/noborus/ov v0.37.0/go.mod h1:cac6+F9N4F0rBKu4jWKiqH0n2lJGiNQpO2OYNQTttmA= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -404,6 +402,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.8.0 h1:mXaMVw7IqxNBxfv3LdWt9MDmcWDQ1fagDH918lOdVaQ= github.com/sagikazarmark/locafero v0.8.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/schollz/closestmatch v0.0.0-20190308193919-1fbe626be92e h1:HFUDYOpUVZ0oTXeZy2A59Lkf69SsOF03Lg1GsI3Xh9o= @@ -431,8 +431,6 @@ github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -459,6 +457,8 @@ github.com/tobischo/argon2 v0.1.0 h1:mwAx/9DK/4rP0xzNifb/XMAf43dU3eG1B3aeF88qu4Y github.com/tobischo/argon2 v0.1.0/go.mod h1:4NLmLFwhWPbT66nRZNgcktV/mibJ6fESoeEp43h9GRw= github.com/tobischo/gokeepasslib/v3 v3.6.1 h1:AShQlTypdM19glj0UUePQcUi56qQyeFI5NcrWnVFudA= github.com/tobischo/gokeepasslib/v3 v3.6.1/go.mod h1:B31dx/dj0egameQrNtuoOx9RnwxnYaZR4kXaahRuZN8= +github.com/twpayne/gitleaks/v8 v8.0.0-20250319121243-993bde9542cc h1:8w2f5DirZbjJ5UgwNQ4Yi6UjhSmHDjj8f6E902RCF2A= +github.com/twpayne/gitleaks/v8 v8.0.0-20250319121243-993bde9542cc/go.mod h1:D3AhHRLVp0DigFQNxAgHcQks8EbF7wCZanT/UbGd0Jo= github.com/twpayne/go-expect v0.0.2-0.20241130000624-916db2914efd h1:/ekqcdG89euFEeFfuFYGF2An2AwsaJHnYxVwW8hqvcw= github.com/twpayne/go-expect v0.0.2-0.20241130000624-916db2914efd/go.mod h1:Z1PlEHxKw23bid0pq2RhO4NMScxckEhBXZLebwJpjrk= github.com/twpayne/go-pinentry v0.3.0 h1:Rr+fEOZXmeItOb4thjeVaBWJKB9Xa/eojolycyF/26c= @@ -499,8 +499,6 @@ github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8u github.com/zalando/go-keyring v0.2.6/go.mod h1:2TCrxYrbUNYfNS/Kgy/LSrkSQzZ5UPVH85RwfczwvcI= github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= -github.com/zricethezav/gitleaks/v8 v8.24.0 h1:yrJ81El2tCBrhp6fapUBvqgCXVdh1w/P5DdZOZUQqB0= -github.com/zricethezav/gitleaks/v8 v8.24.0/go.mod h1:hAWbK85gzn04aqM6jI8paV6YJsUsh6cVV+BYQB6T+Bc= go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= go.etcd.io/gofail v0.2.0 h1:p19drv16FKK345a09a1iubchlw/vmRuksmRzgBIGjcA=
chore
Use standard regexp package for gitleaks
de3b73dc238d53df31209c8242c03506ad58a0c1
2023-07-02 16:42:06
dependabot[bot]
chore(deps): bump github/codeql-action from 2.20.0 to 2.20.1
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8321833fc0c..13d48175228 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,10 +50,10 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 1 - - uses: github/codeql-action/init@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e + - uses: github/codeql-action/init@f6e388ebf0efc915c6c5b165b019ee61a6746a38 with: languages: go - - uses: github/codeql-action/analyze@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e + - uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38 misspell: runs-on: ubuntu-22.04 steps:
chore
bump github/codeql-action from 2.20.0 to 2.20.1
ee6e57140323e055637a2cdd73e039e9bd3dfc1c
2021-10-19 02:27:12
Tom Payne
chore: Tidy up shell quoting
false
diff --git a/internal/chezmoi/maybeshellquote_test.go b/internal/chezmoi/maybeshellquote_test.go deleted file mode 100644 index 37b174fb200..00000000000 --- a/internal/chezmoi/maybeshellquote_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package chezmoi - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestMaybeShellQuote(t *testing.T) { - for s, expected := range map[string]string{ - ``: `''`, - `'`: `\'`, - `''`: `\'\'`, - `'a'`: `\''a'\'`, - `\`: `'\\'`, - `\a`: `'\\a'`, - `$a`: `'$a'`, - `a`: `a`, - `a/b`: `a/b`, - `a b`: `'a b'`, - `--arg`: `--arg`, - `--arg=value`: `--arg=value`, - } { - assert.Equal(t, expected, maybeShellQuote(s), "quoting %q", s) - } -} - -func TestShellQuoteArgs(t *testing.T) { - for _, tc := range []struct { - args []string - expected string - }{ - { - args: []string{}, - expected: "", - }, - { - args: []string{"foo"}, - expected: "foo", - }, - { - args: []string{"foo", "bar baz"}, - expected: "foo 'bar baz'", - }, - } { - assert.Equal(t, tc.expected, ShellQuoteArgs(tc.args)) - } -} diff --git a/internal/cmd/bitwardentemplatefuncs.go b/internal/cmd/bitwardentemplatefuncs.go index 85b70538ee5..a2feaac15da 100644 --- a/internal/cmd/bitwardentemplatefuncs.go +++ b/internal/cmd/bitwardentemplatefuncs.go @@ -5,8 +5,6 @@ import ( "fmt" "os/exec" "strings" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type bitwardenConfig struct { @@ -20,7 +18,7 @@ func (c *Config) bitwardenFieldsTemplateFunc(args ...string) map[string]interfac Fields []map[string]interface{} `json:"fields"` } if err := json.Unmarshal(output, &data); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", c.Bitwarden.Command, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Bitwarden.Command, args), err, output)) return nil } result := make(map[string]interface{}) @@ -45,7 +43,7 @@ func (c *Config) bitwardenOutput(args []string) []byte { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return nil } @@ -60,7 +58,7 @@ func (c *Config) bitwardenTemplateFunc(args ...string) map[string]interface{} { output := c.bitwardenOutput(args) var data map[string]interface{} if err := json.Unmarshal(output, &data); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", c.Bitwarden.Command, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Bitwarden.Command, args), err, output)) return nil } return data diff --git a/internal/cmd/gopasstemplatefuncs.go b/internal/cmd/gopasstemplatefuncs.go index 90cf628c96d..d4c284d24fa 100644 --- a/internal/cmd/gopasstemplatefuncs.go +++ b/internal/cmd/gopasstemplatefuncs.go @@ -7,8 +7,6 @@ import ( "regexp" "github.com/coreos/go-semver/semver" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) var ( @@ -55,7 +53,7 @@ func (c *Config) gopassRawTemplateFunc(id string) string { args := []string{"show", id} output, err := c.gopassOutput(args...) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", c.Gopass.Command, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(c.Gopass.Command, args), err)) return "" } @@ -83,7 +81,7 @@ func (c *Config) gopassTemplateFunc(id string) string { args := []string{"show", "--password", id} output, err := c.gopassOutput(args...) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", c.Gopass.Command, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(c.Gopass.Command, args), err)) return "" } diff --git a/internal/cmd/keepassxctemplatefuncs.go b/internal/cmd/keepassxctemplatefuncs.go index 4b9bc41ac7c..06821341381 100644 --- a/internal/cmd/keepassxctemplatefuncs.go +++ b/internal/cmd/keepassxctemplatefuncs.go @@ -10,8 +10,6 @@ import ( "strings" "github.com/coreos/go-semver/semver" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) // FIXME use chezmoi.AbsPath for keepassxcConfig.Database @@ -57,7 +55,7 @@ func (c *Config) keepassxcAttributeTemplateFunc(entry, attribute string) string args = append(args, c.Keepassxc.Database, entry) output, err := c.runKeepassxcCLICommand(name, args) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", name, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(name, args), err)) return "" } outputStr := strings.TrimSpace(string(output)) @@ -85,12 +83,12 @@ func (c *Config) keepassxcTemplateFunc(entry string) map[string]string { args = append(args, c.Keepassxc.Database, entry) output, err := c.runKeepassxcCLICommand(name, args) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", name, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(name, args), err)) return nil } data, err := parseKeyPassXCOutput(output) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", name, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(name, args), err)) return nil } if c.Keepassxc.cache == nil { @@ -109,7 +107,7 @@ func (c *Config) keepassxcVersion() *semver.Version { cmd := exec.Command(name, args...) output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", name, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(name, args), err)) return nil } c.Keepassxc.version, err = semver.NewVersion(string(bytes.TrimSpace(output))) diff --git a/internal/cmd/onepasswordtemplatefuncs.go b/internal/cmd/onepasswordtemplatefuncs.go index a1ea521f6e9..f7f6401e9bb 100644 --- a/internal/cmd/onepasswordtemplatefuncs.go +++ b/internal/cmd/onepasswordtemplatefuncs.go @@ -6,8 +6,6 @@ import ( "fmt" "os/exec" "strings" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type onepasswordConfig struct { @@ -29,7 +27,7 @@ func (c *Config) onepasswordItem(args ...string) *onePasswordItem { output := c.onepasswordOutput(onepasswordArgs) var onepasswordItem onePasswordItem if err := json.Unmarshal(output, &onepasswordItem); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", c.Onepassword.Command, chezmoi.ShellQuoteArgs(onepasswordArgs), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Onepassword.Command, onepasswordArgs), err, output)) return nil } return &onepasswordItem @@ -78,7 +76,7 @@ func (c *Config) onepasswordOutput(args []string) []byte { cmd.Stderr = stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w: %s", name, chezmoi.ShellQuoteArgs(args), err, bytes.TrimSpace(stderr.Bytes()))) + returnTemplateError(fmt.Errorf("%s: %w: %s", shellQuoteCommand(name, args), err, bytes.TrimSpace(stderr.Bytes()))) return nil } @@ -94,7 +92,7 @@ func (c *Config) onepasswordTemplateFunc(args ...string) map[string]interface{} output := c.onepasswordOutput(onepasswordArgs) var data map[string]interface{} if err := json.Unmarshal(output, &data); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", c.Onepassword.Command, chezmoi.ShellQuoteArgs(onepasswordArgs), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(c.Onepassword.Command, onepasswordArgs), err, output)) return nil } return data diff --git a/internal/cmd/passtemplatefuncs.go b/internal/cmd/passtemplatefuncs.go index 3fb0394dbab..880e97f3827 100644 --- a/internal/cmd/passtemplatefuncs.go +++ b/internal/cmd/passtemplatefuncs.go @@ -4,8 +4,6 @@ import ( "bytes" "fmt" "os/exec" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type passConfig struct { @@ -25,7 +23,7 @@ func (c *Config) passOutput(id string) []byte { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w", name, chezmoi.ShellQuoteArgs(args), err)) + returnTemplateError(fmt.Errorf("%s: %w", shellQuoteCommand(name, args), err)) return nil } diff --git a/internal/cmd/secrettemplatefuncs.go b/internal/cmd/secrettemplatefuncs.go index 69c85cdd12d..6c114185f14 100644 --- a/internal/cmd/secrettemplatefuncs.go +++ b/internal/cmd/secrettemplatefuncs.go @@ -6,8 +6,6 @@ import ( "fmt" "os/exec" "strings" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type secretConfig struct { @@ -27,12 +25,12 @@ func (c *Config) secretJSONTemplateFunc(args ...string) interface{} { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return nil } var value interface{} if err := json.Unmarshal(output, &value); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return nil } if c.Secret.jsonCache == nil { @@ -53,7 +51,7 @@ func (c *Config) secretTemplateFunc(args ...string) string { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return "" } value := string(bytes.TrimSpace(output)) diff --git a/internal/chezmoi/maybeshellquote.go b/internal/cmd/shellquote.go similarity index 69% rename from internal/chezmoi/maybeshellquote.go rename to internal/cmd/shellquote.go index 14e5db59039..b00a4afc046 100644 --- a/internal/chezmoi/maybeshellquote.go +++ b/internal/cmd/shellquote.go @@ -1,4 +1,4 @@ -package chezmoi +package cmd import ( "regexp" @@ -9,8 +9,8 @@ import ( // shell literal. var nonShellLiteralRx = regexp.MustCompile(`[^+\-./0-9=A-Z_a-z]`) -// maybeShellQuote returns s quoted as a shell argument, if necessary. -func maybeShellQuote(s string) string { +// shellQuote returns s quoted as a shell argument, if necessary. +func shellQuote(s string) string { const ( backslash = '\\' singleQuote = '\'' @@ -53,11 +53,15 @@ func maybeShellQuote(s string) string { } } -// ShellQuoteArgs returns args shell quoted and joined into a single string. -func ShellQuoteArgs(args []string) string { - shellQuotedArgs := make([]string, 0, len(args)) +// shellQuoteCommand returns a string containing command and args shell quoted. +func shellQuoteCommand(command string, args []string) string { + if len(args) == 0 { + return shellQuote(command) + } + elems := make([]string, 0, 1+len(args)) + elems = append(elems, shellQuote(command)) for _, arg := range args { - shellQuotedArgs = append(shellQuotedArgs, maybeShellQuote(arg)) + elems = append(elems, shellQuote(arg)) } - return strings.Join(shellQuotedArgs, " ") + return strings.Join(elems, " ") } diff --git a/internal/cmd/shellquote_test.go b/internal/cmd/shellquote_test.go new file mode 100644 index 00000000000..b26306f8ff9 --- /dev/null +++ b/internal/cmd/shellquote_test.go @@ -0,0 +1,55 @@ +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestShellQuote(t *testing.T) { + for s, expected := range map[string]string{ + ``: `''`, + `'`: `\'`, + `''`: `\'\'`, + `'a'`: `\''a'\'`, + `\`: `'\\'`, + `\a`: `'\\a'`, + `$a`: `'$a'`, + `a`: `a`, + `a/b`: `a/b`, + `a b`: `'a b'`, + `--arg`: `--arg`, + `--arg=value`: `--arg=value`, + } { + assert.Equal(t, expected, shellQuote(s), "quoting %q", s) + } +} + +func TestShellQuoteCommand(t *testing.T) { + for _, tc := range []struct { + command string + args []string + expected string + }{ + { + command: "command", + expected: "command", + }, + { + command: "command with spaces", + expected: "'command with spaces'", + }, + { + command: "command", + args: []string{"arg1"}, + expected: "command arg1", + }, + { + command: "command", + args: []string{"arg1", "arg 2 with spaces"}, + expected: "command arg1 'arg 2 with spaces'", + }, + } { + assert.Equal(t, tc.expected, shellQuoteCommand(tc.command, tc.args)) + } +} diff --git a/internal/cmd/vaulttemplatefuncs.go b/internal/cmd/vaulttemplatefuncs.go index 80fb671dd8b..9a2e16ed4d0 100644 --- a/internal/cmd/vaulttemplatefuncs.go +++ b/internal/cmd/vaulttemplatefuncs.go @@ -4,8 +4,6 @@ import ( "encoding/json" "fmt" "os/exec" - - "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type vaultConfig struct { @@ -24,12 +22,12 @@ func (c *Config) vaultTemplateFunc(key string) interface{} { cmd.Stderr = c.stderr output, err := c.baseSystem.IdempotentCmdOutput(cmd) if err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return nil } var data interface{} if err := json.Unmarshal(output, &data); err != nil { - returnTemplateError(fmt.Errorf("%s %s: %w\n%s", name, chezmoi.ShellQuoteArgs(args), err, output)) + returnTemplateError(fmt.Errorf("%s: %w\n%s", shellQuoteCommand(name, args), err, output)) return nil } if c.Vault.cache == nil {
chore
Tidy up shell quoting
dbbfd1dccd2974b798079d43c4bc7fc49510f977
2022-03-07 23:15:50
Tom Payne
chore: Make license output prettier
false
diff --git a/pkg/cmd/licensecmd.go b/pkg/cmd/licensecmd.go index 3a319cc6672..41cf82dc725 100644 --- a/pkg/cmd/licensecmd.go +++ b/pkg/cmd/licensecmd.go @@ -1,6 +1,9 @@ package cmd import ( + "bytes" + + "github.com/charmbracelet/glamour" "github.com/spf13/cobra" "github.com/twpayne/chezmoi/v2/assets/chezmoi.io/docs" @@ -20,5 +23,19 @@ func (c *Config) newLicenseCmd() *cobra.Command { } func (c *Config) runLicenseCmd(cmd *cobra.Command, args []string) error { - return c.writeOutput(docs.License) + renderer, err := glamour.NewTermRenderer( + glamour.WithStyles(glamour.ASCIIStyleConfig), + glamour.WithWordWrap(80), + ) + if err != nil { + return err + } + + licenseMarkdown := bytes.TrimPrefix(docs.License, []byte("# License\n\n")) + license, err := renderer.RenderBytes(licenseMarkdown) + if err != nil { + return err + } + + return c.writeOutput(license) }
chore
Make license output prettier
62a0017cb23b9ca380f696025c28b6520c01ee17
2023-08-01 17:31:52
dependabot[bot]
chore(deps): bump github/codeql-action from 2.20.1 to 2.21.2
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14476a65507..e0524423160 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,10 +51,10 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 1 - - uses: github/codeql-action/init@f6e388ebf0efc915c6c5b165b019ee61a6746a38 + - uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 with: languages: go - - uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38 + - uses: github/codeql-action/analyze@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 misspell: runs-on: ubuntu-22.04 steps:
chore
bump github/codeql-action from 2.20.1 to 2.21.2