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
957f18cb62966242a7435390736e0cbefe548e20
2024-10-23 23:57:44
Ruslan Sayfutdinov
chore: Enable strict mode in mkdocs
false
diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 7d603a3bd22..dbe9ab0fb7a 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -6,6 +6,13 @@ copyright: Copyright © Tom Payne 2018-2024 repo_name: twpayne/chezmoi repo_url: https://github.com/twpayne/chezmoi edit_uri: edit/master/assets/chezmoi.io/docs/ +strict: true + +validation: + omitted_files: warn + absolute_links: relative_to_docs + unrecognized_links: warn + anchors: warn theme: name: material
chore
Enable strict mode in mkdocs
ebfb7b4781e7a42148bf0f03d1e1ee3381ccef2f
2024-10-23 23:57:44
Tom Payne
chore: Increase strictness of help markdown parsing
false
diff --git a/assets/chezmoi.io/docs/reference/templates/keeper-functions/keeperDataFields.md b/assets/chezmoi.io/docs/reference/templates/keeper-functions/keeperDataFields.md index c40ccc8ed16..6af6df9ce55 100644 --- a/assets/chezmoi.io/docs/reference/templates/keeper-functions/keeperDataFields.md +++ b/assets/chezmoi.io/docs/reference/templates/keeper-functions/keeperDataFields.md @@ -3,7 +3,7 @@ `keeperDataFields` returns the `.data.fields` elements of `keeper get --format=json *uid*` indexed by `type`. -## Example +## Examples ``` url = {{ (keeperDataFields "$UID").url }} diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index d6cecf94bc6..0d426a3c585 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -164,13 +164,13 @@ func extractHelp(command string, data []byte, longHelpTermRenderer, exampleTermR stateChange := func(line string, state *stateType) bool { switch { - case strings.HasPrefix(line, "## Flags") || strings.HasPrefix(line, "## Common flags"): + case line == "## Flags" || line == "## Common flags": *state = stateInOptions return true - case strings.HasPrefix(line, "## Example"): // accept singular and plural + case line == "## Examples": *state = stateInExamples return true - case strings.HasPrefix(line, "## Note"): // accept singular and plural + case line == "## Notes": *state = stateInNotes return true case strings.HasPrefix(line, "## "):
chore
Increase strictness of help markdown parsing
c887641baf681d28dbda20649afff8c47ff7ee7b
2023-07-14 20:32:30
Tom Payne
feat: Add support for HCP Vault Secrets
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 3d6275fa70c..caf6f26d0ba 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml +++ b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml @@ -215,6 +215,22 @@ sections: symmetric: type: bool description: Use symmetric GPG encryption + hcpVaultSecrets: + applicationName: + type: string + description: Default application name if none is specified + args: + type: '[]string' + description: Extra args to HCP Vault Secrets CLI command + command: + default: '`vlt`' + description: HCP Vault Secrets CLI command + organizationId: + type: string + description: Default organization ID if none is specified + projectId: + type: string + description: Default project ID if none is specified hooks: '*command*`.post.args`': type: '[]string' diff --git a/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecret.md b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecret.md new file mode 100644 index 00000000000..0319ad7f002 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecret.md @@ -0,0 +1,16 @@ +# `hcpVaultSecret` *key* [*application-name* [*project-id* [*organization-id*]]] + +`hcpVaultSecret` returns the plaintext secret from [HCP Vault +Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets) using `vlt +secrets get --plaintext`. + +If any of *application-name*, *project-id*, or *organization-id* are empty or +omitted, then chezmoi will use the value from the +`hcpVaultSecret.applicationName`, `hcpVaultSecret.projectId`, and +`hcpVaultSecret.organizationId` config variables if they are set and not empty. + +!!! example + + ``` + {{ hcpVaultSecret "username" }} + ``` diff --git a/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecretJson.md b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecretJson.md new file mode 100644 index 00000000000..dcc25dcb26e --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/hcpVaultSecretJson.md @@ -0,0 +1,16 @@ +# `hcpVaultSecretJson` *key* [*application-name* [*project-id* [*organization-id*]]] + +`hcpVaultSecretJson` returns structured data from [HCP Vault +Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets) using `vlt +secrets get --format=json`. + +If any of *application-name*, *project-id*, or *organization-id* are empty or omitted, then +chezmoi will use the value from the `hcpVaultSecret.applicationName`, +`hcpVaultSecret.projectId`, and `hcpVaultSecret.organizationId` config variables +if they are set and not empty. + +!!! example + + ``` + {{ (hcpVaultSecretJson "secret_name" "application_name").created_by.email }} + ``` diff --git a/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/index.md b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/index.md new file mode 100644 index 00000000000..9f0c4cdadf0 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/hcp-vault-secrets-functions/index.md @@ -0,0 +1,10 @@ +# HCP Vault Secrets + +chezmoi includes support for [HCP Vault +Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets) using the `vlt` +CLI to expose data through the `hcpVaultSecret` and `hcpVaultSecretJson` +template functions. + +!!! warning + + HCP Vault Secrets 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 bd0834165b3..2b3b3bbd4ee 100644 --- a/assets/chezmoi.io/docs/user-guide/password-managers/custom.md +++ b/assets/chezmoi.io/docs/user-guide/password-managers/custom.md @@ -7,13 +7,14 @@ 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" }}` | -| 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" }}` | +| 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/hcp-vault-secrets.md b/assets/chezmoi.io/docs/user-guide/password-managers/hcp-vault-secrets.md new file mode 100644 index 00000000000..fa30b792183 --- /dev/null +++ b/assets/chezmoi.io/docs/user-guide/password-managers/hcp-vault-secrets.md @@ -0,0 +1,47 @@ +# HCP Vault Secrets + +chezmoi includes support for [HCP Vault +Secrets](https://developer.hashicorp.com/hcp/docs/vault-secrets) using the `vlt` +CLI to expose data through the `hcpVaultSecret` and `hcpVaultSecretJson` +template functions. + +!!! warning + + HCP Vault Secrets is in beta and chezmoi's interface to it may change. + +Log in using: + +```console +$ vlt login +``` + +The output of the `vlt secrets get --plaintext $SECRET_NAME` is available as the +`hcpVaultSecret` function, for example: + +``` +{{ hcpVaultSecret "secret_name" "application_name" "project_id" "organization_id" }} +``` + +You can set the default values for the application name, project ID, and +organization ID in your config file, for example: + +```toml title="~/.config/chezmoi/chezmoi.toml" +[hcpVaultSecrets] + organizationId = "bf479eab-a292-4b46-92df-e22f5c47eadc" + projectId = "5907a2fa-d26a-462a-8705-74dfe967e87d" + applicationName = "my-application" +``` + +With these default values, you can omit them in the call to `hcpVaultSecret`, for example: + +``` +{{ hcpVaultSecret "secret_name" }} +{{ hcpVaultSecret "other_secret_name" "other_application_name" }} +``` + +Structured data from `vlt secrets get --format=json $SECRET_NAME` is available +as the `hcpVaultSecretJson` template function, for example: + +``` +{{ (hcpVaultSecretJson "secret_name").created_by.email }} +``` diff --git a/assets/chezmoi.io/docs/what-does-chezmoi-do.md b/assets/chezmoi.io/docs/what-does-chezmoi-do.md index 10f5b9f93d7..6ec37aa9b71 100644 --- a/assets/chezmoi.io/docs/what-does-chezmoi-do.md +++ b/assets/chezmoi.io/docs/what-does-chezmoi-do.md @@ -45,9 +45,10 @@ format of your choice. chezmoi can retrieve secrets from [1Password](https://1password.com/), [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/), [Bitwarden](https://bitwarden.com/), [Dashlane](https://www.dashlane.com/), -[gopass](https://www.gopass.pw/), [KeePassXC](https://keepassxc.org/), -[Keeper](https://www.keepersecurity.com/), [LastPass](https://lastpass.com/), -[pass](https://www.passwordstore.org/), +[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), [Vault](https://www.vaultproject.io/), Keychain, [Keyring](https://wiki.gnome.org/Projects/GnomeKeyring), or any command-line diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index ed075f4fb68..89739d276a3 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -65,6 +65,7 @@ nav: - Dashlane: user-guide/password-managers/dashlane.md - ejson: user-guide/password-managers/ejson.md - gopass: user-guide/password-managers/gopass.md + - Hashicorp Vault Secrets: user-guide/password-managers/hcp-vault-secrets.md - KeePassXC: user-guide/password-managers/keepassxc.md - Keychain and Windows Credentials Manager: user-guide/password-managers/keychain-and-windows-credentials-manager.md - Keeper: user-guide/password-managers/keeper.md @@ -254,6 +255,10 @@ nav: - reference/templates/gopass-functions/index.md - gopass: reference/templates/gopass-functions/gopass.md - gopassRaw: reference/templates/gopass-functions/gopassRaw.md + - HCP Vault Secrets functions: + - reference/templates/hcp-vault-secrets-functions/index.md + - hcpVaultSecret: reference/templates/hcp-vault-secrets-functions/hcpVaultSecret.md + - hcpVaultSecretJson: reference/templates/hcp-vault-secrets-functions/hcpVaultSecretJson.md - KeePassXC functions: - reference/templates/keepassxc-functions/index.md - keepassxc: reference/templates/keepassxc-functions/keepassxc.md diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 27e097d26f7..125e5c40bc9 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -124,6 +124,7 @@ type ConfigFile struct { Dashlane dashlaneConfig `json:"dashlane" mapstructure:"dashlane" yaml:"dashlane"` Ejson ejsonConfig `json:"ejson" mapstructure:"ejson" yaml:"ejson"` Gopass gopassConfig `json:"gopass" mapstructure:"gopass" yaml:"gopass"` + HCPVaultSecrets hcpVaultSecretConfig `json:"hcpVaultSecrets" mapstructure:"hcpVaultSecrets" yaml:"hcpVaultSecrets"` Keepassxc keepassxcConfig `json:"keepassxc" mapstructure:"keepassxc" yaml:"keepassxc"` Keeper keeperConfig `json:"keeper" mapstructure:"keeper" yaml:"keeper"` Lastpass lastpassConfig `json:"lastpass" mapstructure:"lastpass" yaml:"lastpass"` @@ -402,6 +403,8 @@ func newConfig(options ...configOption) (*Config, error) { "glob": c.globTemplateFunc, "gopass": c.gopassTemplateFunc, "gopassRaw": c.gopassRawTemplateFunc, + "hcpVaultSecret": c.hcpVaultSecretTemplateFunc, + "hcpVaultSecretJson": c.hcpVaultSecretJSONTemplateFunc, "hexDecode": c.hexDecodeTemplateFunc, "hexEncode": c.hexEncodeTemplateFunc, "include": c.includeTemplateFunc, @@ -2577,6 +2580,9 @@ func newConfigFile(bds *xdg.BaseDirectorySpecification) ConfigFile { Gopass: gopassConfig{ Command: "gopass", }, + HCPVaultSecrets: hcpVaultSecretConfig{ + Command: "vlt", + }, Keepassxc: keepassxcConfig{ Command: "keepassxc-cli", Prompt: true, diff --git a/pkg/cmd/doctorcmd.go b/pkg/cmd/doctorcmd.go index 6d4e9d91c92..2c795af9169 100644 --- a/pkg/cmd/doctorcmd.go +++ b/pkg/cmd/doctorcmd.go @@ -387,6 +387,15 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { versionArgs: []string{"version"}, versionRx: regexp.MustCompile(`^Vault\s+v(\d+\.\d+\.\d+)`), }, + &binaryCheck{ + name: "vlt-command", + binaryname: c.HCPVaultSecrets.Command, + ifNotSet: checkResultWarning, + ifNotExist: checkResultInfo, + versionArgs: []string{"version"}, + versionRx: regexp.MustCompile(`^(\d+\.\d+\.\d+)`), + minVersion: &vltMinVersion, + }, &binaryCheck{ name: "secret-command", binaryname: c.Secret.Command, diff --git a/pkg/cmd/hcpvaultsecretsttemplatefuncs.go b/pkg/cmd/hcpvaultsecretsttemplatefuncs.go new file mode 100644 index 00000000000..3c16d6531dd --- /dev/null +++ b/pkg/cmd/hcpvaultsecretsttemplatefuncs.go @@ -0,0 +1,111 @@ +package cmd + +import ( + "encoding/json" + "fmt" + "os" + "os/exec" + "strings" + + "github.com/coreos/go-semver/semver" + "golang.org/x/exp/slices" + + "github.com/twpayne/chezmoi/v2/pkg/chezmoilog" +) + +type hcpVaultSecretConfig struct { + Command string `json:"command" mapstructure:"command" yaml:"command"` + Args []string `json:"args" mapstructure:"args" yaml:"args"` + ApplicationName string `json:"applicationName" mapstructure:"applicationName" yaml:"applicationName"` + OrganizationID string `json:"organizationId" mapstructure:"organizationId" yaml:"organizationId"` + ProjectID string `json:"projectId" mapstructure:"projectId" yaml:"projectId"` + outputCache map[string][]byte +} + +var vltMinVersion = semver.Version{Major: 0, Minor: 2, Patch: 1} + +func (c *Config) hcpVaultSecretTemplateFunc(key string, additionalArgs ...string) string { + args, err := c.appendHCPVaultSecretsAdditionalArgs( + []string{"secrets", "get", "--plaintext"}, + additionalArgs, + ) + if err != nil { + panic(err) + } + output, err := c.vltOutput(append(args, key)) + if err != nil { + panic(err) + } + return string(output) +} + +func (c *Config) hcpVaultSecretJSONTemplateFunc(key string, additionalArgs ...string) any { + args, err := c.appendHCPVaultSecretsAdditionalArgs( + []string{"secrets", "get", "--format", "json"}, + additionalArgs, + ) + if err != nil { + panic(err) + } + data, err := c.vltOutput(append(args, key)) + if err != nil { + panic(err) + } + var value any + if err := json.Unmarshal(data, &value); err != nil { + panic(err) + } + return value +} + +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 != "" { + args = append(args, "--app-name", c.HCPVaultSecrets.ApplicationName) + } + if len(additionalArgs) > 1 && additionalArgs[1] != "" { + args = append(args, "--project", additionalArgs[1]) + } else if c.HCPVaultSecrets.ProjectID != "" { + args = append(args, "--project", c.HCPVaultSecrets.ProjectID) + } + if len(additionalArgs) > 2 && additionalArgs[2] != "" { + args = append(args, "--organization", additionalArgs[2]) + } else if c.HCPVaultSecrets.OrganizationID != "" { + args = append(args, "--organization", c.HCPVaultSecrets.OrganizationID) + } + if len(additionalArgs) > 3 { + // Add one to the number of received arguments as the hcpVaultSecret + // and hcpVaultSecretJson template functions report this error and take + // the key as the first argument. + return nil, fmt.Errorf("expected 1 to 4 arguments, got %d", len(additionalArgs)+1) + } + return args, nil +} + +func (c *Config) vltOutput(args []string) ([]byte, error) { + args = append(slices.Clone(c.HCPVaultSecrets.Args), args...) + key := strings.Join(args, "\x00") + if data, ok := c.HCPVaultSecrets.outputCache[key]; ok { + return data, nil + } + + cmd := exec.Command(c.HCPVaultSecrets.Command, args...) //nolint:gosec + // Always run the vlt command in the destination path because vlt uses + // relative paths to find its .vlt.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.HCPVaultSecrets.outputCache == nil { + c.HCPVaultSecrets.outputCache = make(map[string][]byte) + } + c.HCPVaultSecrets.outputCache[key] = output + return output, nil +} diff --git a/pkg/cmd/testdata/scripts/doctor_unix.txtar b/pkg/cmd/testdata/scripts/doctor_unix.txtar index a2dcb2f4152..9600d37fabd 100644 --- a/pkg/cmd/testdata/scripts/doctor_unix.txtar +++ b/pkg/cmd/testdata/scripts/doctor_unix.txtar @@ -18,6 +18,7 @@ chmod 755 bin/secret chmod 755 bin/shell chmod 755 bin/vault chmod 755 bin/vimdiff +chmod 755 bin/vlt mkhomedir mksourcedir @@ -54,8 +55,9 @@ stdout '^ok\s+keeper-command\s+' stdout '^ok\s+passhole-command\s+' stdout '^ok\s+lastpass-command\s+' stdout '^ok\s+pass-command\s+' -stdout '^ok\s+vault-command\s+' stdout '^ok\s+rbw-command\s+' +stdout '^ok\s+vault-command\s+' +stdout '^ok\s+vlt-command\s+' stdout '^ok\s+secret-command\s+' chhome home2/user @@ -171,6 +173,10 @@ echo rbw 1.7.0 echo "Vault v1.5.5 ('f5d1ddb3750e7c28e25036e1ef26a4c02379fc01+CHANGES')" -- bin/vimdiff -- #!/bin/sh +-- bin/vlt -- +#!/bin/sh + +echo "0.2.1, git sha (8d9af42c8b98c9527741a239b23a3e384812f514), go1.20.4 arm64" -- home/user/.config/chezmoi/chezmoi.toml -- [keepassxc] command = "keepassxc" diff --git a/pkg/cmd/testdata/scripts/hcpvaultsecrets.txtar b/pkg/cmd/testdata/scripts/hcpvaultsecrets.txtar new file mode 100644 index 00000000000..9cbb2e0053c --- /dev/null +++ b/pkg/cmd/testdata/scripts/hcpvaultsecrets.txtar @@ -0,0 +1,70 @@ +[windows] skip 'UNIX only' +[!windows] chmod 755 bin/vlt + +# test hcpVaultSecret template function +exec chezmoi execute-template '{{ hcpVaultSecret "password" }}' +stdout ^correcthorsebatterystaple$ + +# test hcpVaultSecret template function with app name, project, and organization arguments +exec chezmoi execute-template '{{ hcpVaultSecret "password" "application-name" "project-id" "organization-id" }}' +stdout ^correcthorsebatterystaple$ + +# test hcpVaultSecret template function with empty app name, project, and organization arguments +exec chezmoi execute-template '{{ hcpVaultSecret "password" "" "" "" }}' +stdout ^correcthorsebatterystaple$ + +# test hcpVaultSecretJson template function +exec chezmoi execute-template '{{ (hcpVaultSecretJson "password").created_by.email }}' +stdout ^user@example\.com$ + +chhome home2/user + +# test hcpVaultSecret template function with default app name, project, and organization arguments +exec chezmoi execute-template '{{ hcpVaultSecret "password" }}' +stdout ^default-password$ + +# test hcpVaultSecretJson template function with default project and organization arguments +exec chezmoi execute-template '{{ hcpVaultSecret "password" "other-app-name" }}' +stdout ^other-password$ + +-- bin/vlt -- +#!/bin/sh + +case "$*" in +"secrets get --format json password") + cat <<EOF +{ + "created_at": "2023-06-09T13:14:28.140Z", + "created_by": { + "email": "[email protected]", + "name": "example", + "type": "TYPE_USER" + }, + "latest_version": "2", + "name": "password" +} +EOF + ;; +"secrets get --plaintext password") + echo correcthorsebatterystaple + ;; +"secrets get --plaintext --app-name application-name --project project-id --organization organization-id password") + echo correcthorsebatterystaple + ;; +"secrets get --plaintext --app-name default-app-name --project 5907a2fa-d26a-462a-8705-74dfe967e87d --organization bf479eab-a292-4b46-92df-e22f5c47eadc password") + echo default-password + ;; +"secrets get --plaintext --app-name other-app-name --project 5907a2fa-d26a-462a-8705-74dfe967e87d --organization bf479eab-a292-4b46-92df-e22f5c47eadc password") + echo other-password + ;; +*) + echo "$*: unknown command" + exit 1 + ;; +esac +-- home/user/.keep -- +-- home2/user/.config/chezmoi/chezmoi.toml -- +[hcpVaultSecrets] + applicationName = "default-app-name" + projectId = "5907a2fa-d26a-462a-8705-74dfe967e87d" + organizationId = "bf479eab-a292-4b46-92df-e22f5c47eadc"
feat
Add support for HCP Vault Secrets
eda6f9c7d41c17ff99b39eeae7525cd9c4eef931
2022-03-17 04:31:38
Tom Payne
chore: Build with Go 1.18
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa8096ea12a..03ac08f70ae 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.17.8 + GO_VERSION: 1.18 GOFUMPT_VERSION: 0.3.0 GOLANGCI_LINT_VERSION: 1.44.2 jobs: @@ -324,31 +324,27 @@ jobs: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} run: | go test ./... - test-ubuntu-go1-18: + test-ubuntu-go1-17: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-18.04 steps: - uses: actions/setup-go@v2 with: - go-version: 1.x - - name: install-go-1.18rc1 - run: | - go install golang.org/dl/go1.18rc1@latest - go1.18rc1 download + go-version: 1.17.x - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ runner.os }}-ubuntu-go-1-18-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-ubuntu-go-1-17-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-ubuntu-go-1-18- + ${{ runner.os }}-ubuntu-go-1-17- - name: build run: | - go1.18rc1 build ./... + go build ./... - name: run run: | - go1.18rc1 run . --version + go run . --version - name: install-age run: | cd $(mktemp -d) @@ -359,7 +355,7 @@ jobs: env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} run: | - go1.18rc1 test ./... + go test ./... test-windows: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' @@ -437,7 +433,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: ${{ env.GO_VERSION }} + go-version: 1.17.8 # FIXME use ${{ env.GO_VERSION }} when golangci-lint for Go 1.18 is released - uses: actions/checkout@v2 - uses: golangci/[email protected] with: @@ -459,6 +455,7 @@ jobs: - test-openindiana - test-ubuntu - test-ubuntu-go1-16 + - test-ubuntu-go1-17 - test-voidlinux - test-windows runs-on: ubuntu-18.04
chore
Build with Go 1.18
31780bfe6ea7507c66579fd0e035f31df6d2ef43
2023-12-12 03:11:08
Rony Lutsky
feat: Make mackupApplicationsDir func agnostic to mackup's installation method
false
diff --git a/internal/cmd/mackupcmd_darwin.go b/internal/cmd/mackupcmd_darwin.go index 1ce9d91e729..f70914c58d6 100644 --- a/internal/cmd/mackupcmd_darwin.go +++ b/internal/cmd/mackupcmd_darwin.go @@ -9,6 +9,7 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "regexp" "strings" @@ -21,7 +22,6 @@ 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`) ) type mackupApplicationApplicationConfig struct { @@ -122,49 +122,42 @@ func (c *Config) runMackupAddCmd( } func (c *Config) mackupApplicationsDir() (chezmoi.AbsPath, error) { - brewPrefixCmd := exec.Command("brew", "--prefix") - brewPrefixData, err := brewPrefixCmd.Output() + mackupBinaryPath, err := exec.LookPath("mackup") if err != nil { - return chezmoi.EmptyAbsPath, err + return chezmoi.EmptyAbsPath, fmt.Errorf("mackup binary not found in PATH (%w)", err) } - brewPrefix := chezmoi.NewAbsPath(strings.TrimRight(string(brewPrefixData), "\n")) - - mackupVersionCmd := exec.Command("mackup", "--version") - mackupVersionData, err := mackupVersionCmd.Output() + mackupBinaryPathResolved, err := filepath.EvalSymlinks(mackupBinaryPath) if err != nil { return chezmoi.EmptyAbsPath, err } - mackupVersionMatch := mackupVersionRx.FindSubmatch(mackupVersionData) - if mackupVersionMatch == nil { - return chezmoi.EmptyAbsPath, fmt.Errorf( - "%q: cannot determine Mackup version", - mackupVersionData, - ) - } - mackupVersion := string(mackupVersionMatch[1]) + mackupBinaryPathAbs := chezmoi.NewAbsPath(mackupBinaryPathResolved) - libDirAbsPath := brewPrefix.JoinString("Cellar", "mackup", mackupVersion, "libexec", "lib") + libDirAbsPath := mackupBinaryPathAbs.Dir().Dir().JoinString("lib") dirEntries, err := c.baseSystem.ReadDir(libDirAbsPath) if err != nil { return chezmoi.EmptyAbsPath, err } - var pythonDirRelPath chezmoi.RelPath + for _, dirEntry := range dirEntries { - if dirEntry.IsDir() && strings.HasPrefix(dirEntry.Name(), "python") { - pythonDirRelPath = chezmoi.NewRelPath(dirEntry.Name()) - break + if !dirEntry.IsDir() || !strings.HasPrefix(dirEntry.Name(), "python") { + continue } - } - if pythonDirRelPath.Empty() { - return chezmoi.EmptyAbsPath, fmt.Errorf( - "%s: could not find python directory", - libDirAbsPath, - ) + + 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 + } + + return mackupAppsDir, nil } - return libDirAbsPath.Join(pythonDirRelPath). - JoinString("site-packages", "mackup", "applications"), - nil + return chezmoi.EmptyAbsPath, fmt.Errorf( + "mackup python directory cannot be found: %s", + libDirAbsPath, + ) } func parseMackupApplication(data []byte) (mackupApplicationConfig, error) { diff --git a/internal/cmd/testdata/scripts/mackupbrew_darwin.txtar b/internal/cmd/testdata/scripts/mackupbrew_darwin.txtar index a6337551340..14bd8deef6d 100644 --- a/internal/cmd/testdata/scripts/mackupbrew_darwin.txtar +++ b/internal/cmd/testdata/scripts/mackupbrew_darwin.txtar @@ -1,8 +1,9 @@ [!darwin] skip 'Darwin only' # simulate a brew installation of mackup -chmod 755 opt/homebrew/Cellar/mackup/0.8.32/bin/mackup -chmod 755 opt/homebrew/bin/brew +chmod 755 opt/homebrew/Cellar/mackup/0.8.32/libexec/bin/mackup +mkdir opt/homebrew/Cellar/mackup/0.8.32/bin opt/homebrew/bin +symlink opt/homebrew/Cellar/mackup/0.8.32/bin/mackup -> ../libexec/bin/mackup symlink opt/homebrew/bin/mackup -> ../Cellar/mackup/0.8.32/bin/mackup env PATH=$WORK/opt/homebrew/bin:$PATH @@ -29,17 +30,8 @@ name = Curl [configuration_files] .netrc .curlrc --- opt/homebrew/Cellar/mackup/0.8.32/bin/mackup -- -#!/bin/sh - -case "$*" in -"--version") - echo "Mackup 0.8.32" - ;; -*) - echo "Usage:" - ;; -esac +-- opt/homebrew/Cellar/mackup/0.8.32/libexec/bin/mackup -- +# mackup binary -- opt/homebrew/Cellar/mackup/0.8.32/libexec/lib/python3.9/site-packages/mackup/applications/vscode.cfg -- [application] name = Visual Studio Code @@ -53,14 +45,3 @@ Library/Application Support/Code/User/settings.json Code/User/snippets Code/User/keybindings.json Code/User/settings.json --- opt/homebrew/bin/brew -- -#!/bin/sh - -case "$*" in -"--prefix") - echo "opt/homebrew" - ;; -*) - echo "Error: Unknown command $*" - ;; -esac diff --git a/internal/cmd/testdata/scripts/mackupmacports_darwin.txtar b/internal/cmd/testdata/scripts/mackupmacports_darwin.txtar new file mode 100644 index 00000000000..a729e475cac --- /dev/null +++ b/internal/cmd/testdata/scripts/mackupmacports_darwin.txtar @@ -0,0 +1,46 @@ +[!darwin] skip 'Darwin only' + +# simulate a macports installation of mackup +chmod 755 opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/mackup +mkdir opt/local/bin +symlink opt/local/bin/mackup -> ../Library/Frameworks/Python.framework/Versions/3.11/bin/mackup +env PATH=$WORK/opt/local/bin:$PATH + +# test that chezmoi mackup add adds normal dotfiles +exec chezmoi mackup add curl +cmp $CHEZMOISOURCEDIR/dot_curlrc golden/dot_curlrc + +# 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 + +-- golden/dot_curlrc -- +# contents of .curlrc +-- golden/settings.json -- +# contents of .config/Code/User/settings.json +-- home/user/.config/Code/User/settings.json -- +# contents of .config/Code/User/settings.json +-- home/user/.curlrc -- +# contents of .curlrc +-- home/user/.mackup/curl.cfg -- +[application] +name = Curl + +[configuration_files] +.netrc +.curlrc +-- opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/mackup -- +# mackup binary +-- opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mackup/applications/vscode.cfg -- +[application] +name = Visual Studio Code + +[configuration_files] +Library/Application Support/Code/User/snippets +Library/Application Support/Code/User/keybindings.json +Library/Application Support/Code/User/settings.json + +[xdg_configuration_files] +Code/User/snippets +Code/User/keybindings.json +Code/User/settings.json diff --git a/internal/cmd/testdata/scripts/mackuppip_darwin.txtar b/internal/cmd/testdata/scripts/mackuppip_darwin.txtar new file mode 100644 index 00000000000..8b2b8eb64a1 --- /dev/null +++ b/internal/cmd/testdata/scripts/mackuppip_darwin.txtar @@ -0,0 +1,46 @@ +[!darwin] skip 'Darwin only' + +# simulate a pip installation of mackup +chmod 755 usr/local/bin/mackup +# version 3.9 of python without mackup +mkdir usr/local/lib/python3.9/site-packages +env PATH=$WORK/usr/local/bin:$PATH + +# test that chezmoi mackup add adds normal dotfiles +exec chezmoi mackup add curl +cmp $CHEZMOISOURCEDIR/dot_curlrc golden/dot_curlrc + +# 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 + +-- golden/dot_curlrc -- +# contents of .curlrc +-- golden/settings.json -- +# contents of .config/Code/User/settings.json +-- home/user/.config/Code/User/settings.json -- +# contents of .config/Code/User/settings.json +-- home/user/.curlrc -- +# contents of .curlrc +-- home/user/.mackup/curl.cfg -- +[application] +name = Curl + +[configuration_files] +.netrc +.curlrc +-- usr/local/bin/mackup -- +# mackup binary +-- usr/local/lib/python3.11/site-packages/mackup/applications/vscode.cfg -- +[application] +name = Visual Studio Code + +[configuration_files] +Library/Application Support/Code/User/snippets +Library/Application Support/Code/User/keybindings.json +Library/Application Support/Code/User/settings.json + +[xdg_configuration_files] +Code/User/snippets +Code/User/keybindings.json +Code/User/settings.json diff --git a/internal/cmd/testdata/scripts/mackuppipx_darwin.txtar b/internal/cmd/testdata/scripts/mackuppipx_darwin.txtar new file mode 100644 index 00000000000..17f026944ce --- /dev/null +++ b/internal/cmd/testdata/scripts/mackuppipx_darwin.txtar @@ -0,0 +1,46 @@ +[!darwin] skip 'Darwin only' + +# simulate a pipx installation of mackup +chmod 755 home/.local/pipx/venvs/mackup/bin/mackup +mkdir home/.local/bin +symlink home/.local/bin/mackup -> ../pipx/venvs/mackup/bin/mackup +env PATH=$WORK/home/.local/bin:$PATH + +# test that chezmoi mackup add adds normal dotfiles +exec chezmoi mackup add curl +cmp $CHEZMOISOURCEDIR/dot_curlrc golden/dot_curlrc + +# 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 + +-- golden/dot_curlrc -- +# contents of .curlrc +-- golden/settings.json -- +# contents of .config/Code/User/settings.json +-- home/.local/pipx/venvs/mackup/bin/mackup -- +# mackup binary +-- home/.local/pipx/venvs/mackup/lib/python3.11/site-packages/mackup/applications/vscode.cfg -- +[application] +name = Visual Studio Code + +[configuration_files] +Library/Application Support/Code/User/snippets +Library/Application Support/Code/User/keybindings.json +Library/Application Support/Code/User/settings.json + +[xdg_configuration_files] +Code/User/snippets +Code/User/keybindings.json +Code/User/settings.json +-- home/user/.config/Code/User/settings.json -- +# contents of .config/Code/User/settings.json +-- home/user/.curlrc -- +# contents of .curlrc +-- home/user/.mackup/curl.cfg -- +[application] +name = Curl + +[configuration_files] +.netrc +.curlrc
feat
Make mackupApplicationsDir func agnostic to mackup's installation method
6cae2f11085ac6138f1bc01358f287527cca121d
2025-01-17 11:22:04
Tom Payne
chore: Update tools
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f321e026171..aa51bb0d807 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ env: CHOCOLATEY_VERSION: 2.4.1 # https://github.com/chocolatey/choco/releases EDITORCONFIG_CHECKER_VERSION: 3.1.2 # https://github.com/editorconfig-checker/editorconfig-checker/releases FIND_TYPOS_VERSION: 0.0.3 # https://github.com/twpayne/find-typos/tags - GO_VERSION: 1.23.4 # https://go.dev/doc/devel/release + GO_VERSION: 1.23.5 # https://go.dev/doc/devel/release GOFUMPT_VERSION: 0.7.0 # https://github.com/mvdan/gofumpt/releases GOLANGCI_LINT_VERSION: 1.63.4 # https://github.com/golangci/golangci-lint/releases GOLINES_VERSION: 0.12.2 # https://github.com/segmentio/golines/releases @@ -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.5.18 # https://github.com/astral-sh/uv/releases + UV_VERSION: 0.5.20 # https://github.com/astral-sh/uv/releases jobs: changes: runs-on: ubuntu-22.04
chore
Update tools
a119c5263382ecba275fe3e40b80fc9958f89d64
2024-11-20 02:36:05
Ruslan Sayfutdinov
chore: Tune Windows tests split
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d0026e0aab..635b5f41c0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -346,7 +346,7 @@ jobs: strategy: fail-fast: false matrix: - test-index: [0, 1] + test-index: [0, 1, 2] needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: windows-2022 @@ -369,9 +369,11 @@ jobs: run: | if (${{ matrix.test-index }} -eq 0) { go test ./... -short -race - go test ./internal/cmd -run=TestScript -filter='^[0-9a-hA-h]' -race + go test ./internal/cmd -run=TestScript -filter='^[0-9a-cA-C]' -race + } elseif (${{ matrix.test-index }} -eq 1) { + go test ./internal/cmd -run=TestScript -filter='^[d-lD-L]' -race } else { - go test ./internal/cmd -run=TestScript -filter='^[i-zI-Z]' -race + go test ./internal/cmd -run=TestScript -filter='^[m-zM-Z]' -race } check: runs-on: ubuntu-22.04
chore
Tune Windows tests split
f4904293d9e3d5297f481b0b1ec00981716fff39
2024-03-17 06:15:31
aarondill
fix: pass the `--needed` flag to pacman
false
diff --git a/internal/cmd/upgradecmd_unix.go b/internal/cmd/upgradecmd_unix.go index 5020d97a147..01fad572134 100644 --- a/internal/cmd/upgradecmd_unix.go +++ b/internal/cmd/upgradecmd_unix.go @@ -109,7 +109,7 @@ func (c *Config) upgradeUNIXPackage( if useSudo { args = append(args, "sudo") } - args = append(args, "pacman", "-S", "chezmoi") + args = append(args, "pacman", "-S", "--needed", "chezmoi") return c.run(chezmoi.EmptyAbsPath, args[0], args[1:]) }
fix
pass the `--needed` flag to pacman
90a5ce5e930beb5c0ec8d3d9b806c50a9c70baba
2022-10-24 22:42:53
Tom Payne
chore: Add package descriptions
false
diff --git a/.golangci.yml b/.golangci.yml index d62b736f624..3d92738435e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -134,7 +134,6 @@ linters-settings: stylecheck: checks: - all - - -ST1000 issues: include: diff --git a/assets/chezmoi.io/docs/docs.go b/assets/chezmoi.io/docs/docs.go index a4fd6e96dd1..2bcfa52bf81 100644 --- a/assets/chezmoi.io/docs/docs.go +++ b/assets/chezmoi.io/docs/docs.go @@ -1,3 +1,4 @@ +// Package docs contains chezmoi's documentation. package docs import _ "embed" diff --git a/pkg/archivetest/archivetest.go b/pkg/archivetest/archivetest.go index de50cd02bb9..937b3eca726 100644 --- a/pkg/archivetest/archivetest.go +++ b/pkg/archivetest/archivetest.go @@ -1,3 +1,4 @@ +// Package archivetest provides useful functions for testing archives. package archivetest import ( diff --git a/pkg/chezmoibubbles/chezmoibubbles.go b/pkg/chezmoibubbles/chezmoibubbles.go new file mode 100644 index 00000000000..0958cfeca89 --- /dev/null +++ b/pkg/chezmoibubbles/chezmoibubbles.go @@ -0,0 +1,3 @@ +// Package chezmoibubbles provides text user interface components for chezmoi +// using github.com/charmbracelet/bubbletea. +package chezmoibubbles
chore
Add package descriptions
49791f96a87d14817d346d29e843f736302ef1ee
2024-01-13 23:19:12
Tom Payne
fix: Handle keepassxc-cli localization
false
diff --git a/internal/cmd/keepassxctemplatefuncs.go b/internal/cmd/keepassxctemplatefuncs.go index 331d114a03c..188fcfdad2f 100644 --- a/internal/cmd/keepassxctemplatefuncs.go +++ b/internal/cmd/keepassxctemplatefuncs.go @@ -194,9 +194,11 @@ func (c *Config) keepassxcOutputOpen(command string, args ...string) ([]byte, er return nil, err } - // Start the keepassxc-cli open command. + // Start the keepassxc-cli open command. Set the LANGUAGE environment + // variable to ensure that the prompt is in US English. cmdArgs := append(slices.Clone(c.Keepassxc.Args), "open", c.Keepassxc.Database.String()) cmd := exec.Command(c.Keepassxc.Command, cmdArgs...) //nolint:gosec + cmd.Env = append(os.Environ(), "LANGUAGE=en") cmd.Stdin = console.Tty() cmd.Stdout = console.Tty() cmd.Stderr = console.Tty()
fix
Handle keepassxc-cli localization
aca64e8eccab842584e5ff2bf2a55a13e6489434
2024-11-11 04:25:38
Ruslan Sayfutdinov
chore: Fix permissions for clear-pr-caches job
false
diff --git a/.github/workflows/clear-pr-caches.yml b/.github/workflows/clear-pr-caches.yml index 0e4115ad6a1..876411aa866 100644 --- a/.github/workflows/clear-pr-caches.yml +++ b/.github/workflows/clear-pr-caches.yml @@ -7,6 +7,8 @@ on: jobs: clear-caches: runs-on: ubuntu-22.04 + permissions: + actions: write steps: - name: clear-caches uses: theAngularGuy/clear-cache-of-pull-request@60c83956d63c7b3745d6cde10d711aa0e50c2501
chore
Fix permissions for clear-pr-caches job
414290af18eef1e72c4e83b6ab7e2977a0da5ac6
2023-05-09 22:24:48
Austin Ziegler
docs: Improved Bitwarden login documentation
false
diff --git a/assets/chezmoi.io/docs/user-guide/password-managers/bitwarden.md b/assets/chezmoi.io/docs/user-guide/password-managers/bitwarden.md index 4a38a14131b..a618318ce22 100644 --- a/assets/chezmoi.io/docs/user-guide/password-managers/bitwarden.md +++ b/assets/chezmoi.io/docs/user-guide/password-managers/bitwarden.md @@ -4,13 +4,16 @@ chezmoi includes support for [Bitwarden](https://bitwarden.com/) using the [Bitwarden CLI](https://bitwarden.com/help/cli) to expose data as a template function. -Log in to Bitwarden using: +Log in to Bitwarden using a normal method ```console -$ bw login $BITWARDEN_EMAIL +$ bw login $BITWARDEN_EMAIL # or +$ bw login --apikey # or +$ bw login --sso ``` -Unlock your Bitwarden vault: +If required, unlock your Bitwarden vault (API key and SSO logins always require +an explicit unlock step): ```console $ bw unlock @@ -20,10 +23,17 @@ Set the `BW_SESSION` environment variable, as instructed. !!! tip "Bitwarden Session One-liner" - Set `BW_SESSION` automatically with: + The `BW_SESSION` value can be set directly. The exact combination differs + based on whether you are currently logged into Bitwarden and how you log + into Bitwarden. ```console - $ export BW_SESSION=$(bw {login,unlock} --raw) + $ # You are already logged in with any method + $ export BW_SESSION=$(bw unlock --raw) + $ # You are not logged in and log in with an email + $ export BW_SESSION=$(bw login $BITWARDEN_EMAIL --raw) + $ # You are not logged in and login with SSO or API key + $ export BW_SESSION=$(bw login --sso && bw unlock --raw) ``` The structured data from `bw get` is available as the `bitwarden` template @@ -49,7 +59,9 @@ attachment named `id_rsa`, you can retrieve its value with: ``` {{ bitwardenAttachment "id_rsa" "bf22e4b4-ae4a-4d1c-8c98-ac620004b628" }} ``` + or + ``` {{ bitwardenAttachmentByRef "id_rsa" "item" "example.com" }} ```
docs
Improved Bitwarden login documentation
8f7cc0ac231ee2fa8b982feee31ced08e87589d3
2022-09-01 00:39:45
Tom Payne
chore: Add test for issue #2315
false
diff --git a/pkg/cmd/testdata/scripts/issue2315.txtar b/pkg/cmd/testdata/scripts/issue2315.txtar new file mode 100644 index 00000000000..40763a41d9c --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue2315.txtar @@ -0,0 +1,21 @@ +[windows] skip 'UNIX only' + +# Test that chezmoi init runs run_before_ scripts before executing templates +env PATH=$PATH:$HOME/bin +exec chezmoi init --apply +cmp $HOME/.file golden/.file + +-- golden/.file -- +output +-- golden/binary.sh -- +#!/bin/sh + +echo output +-- home/user/.local/share/chezmoi/run_before_install-binary.sh -- +#!/bin/sh + +cp $WORK/golden/binary.sh $HOME/bin +chmod a+x $HOME/bin/binary.sh +-- home/user/.local/share/chezmoi/dot_file.tmpl -- +{{ output "binary.sh" -}} +-- home/user/bin/.keep --
chore
Add test for issue #2315
92f57dbfcee4d545e50bf2cf15f1c24f700e9164
2023-05-14 22:40:24
Tom Payne
fix: Only create empty files if they have the empty_ attribute
false
diff --git a/assets/chezmoi.io/docs/reference/source-state-attributes.md b/assets/chezmoi.io/docs/reference/source-state-attributes.md index 0000251ad21..464a9296e7d 100644 --- a/assets/chezmoi.io/docs/reference/source-state-attributes.md +++ b/assets/chezmoi.io/docs/reference/source-state-attributes.md @@ -40,15 +40,16 @@ to as "attributes": Different target types allow different prefixes and suffixes. The order of prefixes is important. -| Target type | Source type | Allowed prefixes in order | Allowed suffixes | -| ------------- | ----------- | ----------------------------------------------------------------------- | ---------------- | -| Directory | Directory | `external_` or `remove_`, `exact_`, `private_`, `readonly_`, `dot_` | *none* | -| Regular file | File | `encrypted_`, `private_`, `executable_`, `dot_` | `.tmpl` | -| Create file | File | `create_`, `encrypted_`, `private_`, `readonly_`, `executable_`, `dot_` | `.tmpl` | -| Modify file | File | `modify_`, `encrypted_`, `private_`, `readonly_`, `executable_`, `dot_` | `.tmpl` | -| Remove | File | `remove_`, `dot_` | *none* | -| Script | File | `run_`, `once_` or `onchange_`, `before_` or `after_` | `.tmpl` | -| Symbolic link | File | `symlink_`, `dot_` | `.tmpl` | +| Target type | Source type | Allowed prefixes in order | Allowed suffixes | +| ---------------- | ----------- | --------------------------------------------------------------------------------- | ---------------- | +| Directory | Directory | `external_`, `exact_`, `private_`, `readonly_`, `dot_` | *none* | +| Remove directory | Directory | `remove_`, `dot_` | *none* | +| Regular file | File | `encrypted_`, `private_`, `executable_`, `empty_`, `dot_` | `.tmpl` | +| Create file | File | `create_`, `encrypted_`, `private_`, `readonly_`, `empty_`, `executable_`, `dot_` | `.tmpl` | +| Modify file | File | `modify_`, `encrypted_`, `private_`, `readonly_`, `executable_`, `dot_` | `.tmpl` | +| Remove file | File | `remove_`, `dot_` | *none* | +| Script | File | `run_`, `once_` or `onchange_`, `before_` or `after_` | `.tmpl` | +| Symbolic link | File | `symlink_`, `dot_` | `.tmpl` | The `literal_` prefix and `.literal` suffix can appear anywhere and stop attribute parsing. This permits filenames that would otherwise conflict with diff --git a/pkg/chezmoi/attr.go b/pkg/chezmoi/attr.go index 18063af41d7..ef72486b387 100644 --- a/pkg/chezmoi/attr.go +++ b/pkg/chezmoi/attr.go @@ -173,6 +173,7 @@ func parseFileAttr(sourceName, encryptedSuffix string) FileAttr { name, encrypted = CutPrefix(name, encryptedPrefix) name, private = CutPrefix(name, privatePrefix) name, readOnly = CutPrefix(name, readOnlyPrefix) + name, empty = CutPrefix(name, emptyPrefix) name, executable = CutPrefix(name, executablePrefix) case strings.HasPrefix(name, removePrefix): sourceFileType = SourceFileTypeRemove @@ -276,6 +277,9 @@ func (fa FileAttr) SourceName(encryptedSuffix string) string { if fa.ReadOnly { sourceName += readOnlyPrefix } + if fa.Empty { + sourceName += emptyPrefix + } if fa.Executable { sourceName += executablePrefix } diff --git a/pkg/chezmoi/attr_test.go b/pkg/chezmoi/attr_test.go index 61d09cc27ca..54415d974b8 100644 --- a/pkg/chezmoi/attr_test.go +++ b/pkg/chezmoi/attr_test.go @@ -97,6 +97,7 @@ func TestFileAttr(t *testing.T) { assert.NoError(t, combinator.Generate(&fileAttrs, struct { Type SourceFileTargetType TargetName []string + Empty []bool Encrypted []bool Executable []bool Private []bool @@ -105,6 +106,7 @@ func TestFileAttr(t *testing.T) { }{ Type: SourceFileTypeCreate, TargetName: []string{}, + Empty: []bool{false, true}, Encrypted: []bool{false, true}, Executable: []bool{false, true}, Private: []bool{false, true}, diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index bdb2d713a1c..52f86e15403 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -1537,7 +1537,7 @@ func (s *SourceState) newCreateTargetStateEntryFunc( } return &TargetStateFile{ lazyContents: lazyContents, - empty: true, + empty: fileAttr.Empty, perm: fileAttr.perm() &^ s.umask, sourceAttr: SourceAttr{ Encrypted: fileAttr.Encrypted, diff --git a/pkg/cmd/chattrcmd.go b/pkg/cmd/chattrcmd.go index 6d414be4c01..5f0dd1722ec 100644 --- a/pkg/cmd/chattrcmd.go +++ b/pkg/cmd/chattrcmd.go @@ -475,6 +475,7 @@ func (m *modifier) modifyFileAttr(fileAttr chezmoi.FileAttr) chezmoi.FileAttr { return chezmoi.FileAttr{ TargetName: fileAttr.TargetName, Type: chezmoi.SourceFileTypeCreate, + Empty: m.encrypted.modify(fileAttr.Empty), Encrypted: m.encrypted.modify(fileAttr.Encrypted), Executable: m.executable.modify(fileAttr.Executable), Private: m.private.modify(fileAttr.Private), diff --git a/pkg/cmd/testdata/scripts/issue2995.txtar b/pkg/cmd/testdata/scripts/issue2995.txtar new file mode 100644 index 00000000000..8d24c3ca446 --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue2995.txtar @@ -0,0 +1,17 @@ +# test that chezmoi apply only creates empty files if they have the empty_ attribute +exec chezmoi apply +! exists $HOME/new.txt +exists $HOME/create-new.txt +cmp $HOME/existing.txt golden/existing.txt +cmp $HOME/existing-empty.txt golden/existing-empty.txt + +-- golden/existing-empty.txt -- +-- golden/existing.txt -- +# contents of existing.txt +-- home/user/.local/share/chezmoi/create_empty_create-new.txt -- +-- home/user/.local/share/chezmoi/create_empty_existing-empty.txt -- +-- home/user/.local/share/chezmoi/create_existing.txt -- +-- home/user/.local/share/chezmoi/create_new.txt -- +-- home/user/existing-empty.txt -- +-- home/user/existing.txt -- +# contents of existing.txt
fix
Only create empty files if they have the empty_ attribute
243aaa88dba687e536e679aed8a022defef3aa6e
2022-12-06 03:17:41
Tom Payne
feat: Add --path-style option to managed and unmanaged commands
false
diff --git a/assets/chezmoi.io/docs/reference/commands/managed.md b/assets/chezmoi.io/docs/reference/commands/managed.md index 7a19f5d135b..928cee0c21b 100644 --- a/assets/chezmoi.io/docs/reference/commands/managed.md +++ b/assets/chezmoi.io/docs/reference/commands/managed.md @@ -4,6 +4,11 @@ List all managed entries in the destination directory under all *path*s in alphabetical order. When no *path*s are supplied, list all managed entries in the destination directory in alphabetical order. +## `-p`, `--path-style` `absolute`|`relative` + +Print paths in the given style. Relative paths are relative to the destination +directory. The default is `relative`. + !!! example ```console diff --git a/assets/chezmoi.io/docs/reference/commands/unmanaged.md b/assets/chezmoi.io/docs/reference/commands/unmanaged.md index 78a49116173..5c711644bf7 100644 --- a/assets/chezmoi.io/docs/reference/commands/unmanaged.md +++ b/assets/chezmoi.io/docs/reference/commands/unmanaged.md @@ -5,6 +5,11 @@ unmanaged files in the destination directory. It is an error to supply *path*s that are not found on the filesystem. +## `-p`, `--path-style` `absolute`|`relative` + +Print paths in the given style. Relative paths are relative to the destination +directory. The default is `relative`. + !!! example ```console diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index c4fb94464c1..5f8040e4b34 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -168,6 +168,7 @@ type Config struct { remove removeCmdConfig secret secretCmdConfig state stateCmdConfig + unmanaged unmanagedCmdConfig upgrade upgradeCmdConfig // Version information. @@ -307,7 +308,8 @@ func newConfig(options ...configOption) (*Config, error) { recurseSubmodules: true, }, managed: managedCmdConfig{ - filter: chezmoi.NewEntryTypeFilter(chezmoi.EntryTypesAll, chezmoi.EntryTypesNone), + filter: chezmoi.NewEntryTypeFilter(chezmoi.EntryTypesAll, chezmoi.EntryTypesNone), + pathStyle: pathStyleRelative, }, mergeAll: mergeAllCmdConfig{ recursive: true, @@ -315,6 +317,9 @@ func newConfig(options ...configOption) (*Config, error) { reAdd: reAddCmdConfig{ filter: chezmoi.NewEntryTypeFilter(chezmoi.EntryTypesAll, chezmoi.EntryTypesNone), }, + unmanaged: unmanagedCmdConfig{ + pathStyle: pathStyleRelative, + }, upgrade: upgradeCmdConfig{ owner: gitHubOwner, repo: gitHubRepo, diff --git a/pkg/cmd/managedcmd.go b/pkg/cmd/managedcmd.go index 2784fdced23..d85cdfd26ed 100644 --- a/pkg/cmd/managedcmd.go +++ b/pkg/cmd/managedcmd.go @@ -11,7 +11,8 @@ import ( ) type managedCmdConfig struct { - filter *chezmoi.EntryTypeFilter + filter *chezmoi.EntryTypeFilter + pathStyle pathStyle } func (c *Config) newManagedCmd() *cobra.Command { @@ -28,8 +29,12 @@ func (c *Config) newManagedCmd() *cobra.Command { flags := managedCmd.Flags() flags.VarP(c.managed.filter.Exclude, "exclude", "x", "Exclude entry types") flags.VarP(c.managed.filter.Include, "include", "i", "Include entry types") + flags.VarP(&c.managed.pathStyle, "path-style", "p", "Path style") registerExcludeIncludeFlagCompletionFuncs(managedCmd) + if err := managedCmd.RegisterFlagCompletionFunc("path-style", pathStyleFlagCompletionFunc); err != nil { + panic(err) + } return managedCmd } @@ -83,7 +88,12 @@ func (c *Config) runManagedCmd(cmd *cobra.Command, args []string, sourceState *c sort.Sort(targetRelPaths) builder := strings.Builder{} for _, targetRelPath := range targetRelPaths { - fmt.Fprintln(&builder, targetRelPath) + switch c.managed.pathStyle { + case pathStyleAbsolute: + fmt.Fprintln(&builder, c.DestDirAbsPath.Join(targetRelPath)) + case pathStyleRelative: + fmt.Fprintln(&builder, targetRelPath) + } } return c.writeOutputString(builder.String()) } diff --git a/pkg/cmd/pathstyle.go b/pkg/cmd/pathstyle.go new file mode 100644 index 00000000000..ec46619acb3 --- /dev/null +++ b/pkg/cmd/pathstyle.go @@ -0,0 +1,43 @@ +package cmd + +import ( + "fmt" + + "github.com/twpayne/chezmoi/v2/pkg/chezmoi" +) + +type pathStyle string + +const ( + pathStyleAbsolute pathStyle = "absolute" + pathStyleRelative pathStyle = "relative" +) + +var ( + pathStyleStrings = []string{ + pathStyleAbsolute.String(), + pathStyleRelative.String(), + } + + pathStyleFlagCompletionFunc = chezmoi.FlagCompletionFunc(pathStyleStrings) +) + +// Set implements github.com/spf13/pflag.Value.Set. +func (p *pathStyle) Set(s string) error { + uniqueAbbreviations := chezmoi.UniqueAbbreviations(pathStyleStrings) + pathStyleStr, ok := uniqueAbbreviations[s] + if !ok { + return fmt.Errorf("%s: unknown path style", s) + } + *p = pathStyle(pathStyleStr) + return nil +} + +func (p pathStyle) String() string { + return string(p) +} + +// Type implements github.com/spf13/pflag.Value.Type. +func (p pathStyle) Type() string { + return "absolute|relative" +} diff --git a/pkg/cmd/testdata/scripts/managed.txtar b/pkg/cmd/testdata/scripts/managed.txtar index 2416ac178c3..1908e33b84d 100644 --- a/pkg/cmd/testdata/scripts/managed.txtar +++ b/pkg/cmd/testdata/scripts/managed.txtar @@ -60,6 +60,10 @@ cmp stdout golden/managed-with-nodir-args exec chezmoi managed $HOME${/}.dir $HOME${/}.non-exist cmp stdout golden/managed-with-absent-args +# test chezmoi managed --path-style=absolute +[!windows] exec chezmoi managed --path-style=absolute +[!windows] cmpenv stdout golden/managed-absolute + chhome home2/user # test that chezmoi managed does not evaluate templates @@ -81,6 +85,21 @@ cmp stdout golden/managed2 .remove .symlink .template +-- golden/managed-absolute -- +$WORK/home/user/.create +$WORK/home/user/.dir +$WORK/home/user/.dir/file +$WORK/home/user/.dir/subdir +$WORK/home/user/.dir/subdir/file +$WORK/home/user/.empty +$WORK/home/user/.encrypted +$WORK/home/user/.executable +$WORK/home/user/.file +$WORK/home/user/.private +$WORK/home/user/.readonly +$WORK/home/user/.remove +$WORK/home/user/.symlink +$WORK/home/user/.template -- golden/managed-exclude-encrypted -- .create .dir diff --git a/pkg/cmd/testdata/scripts/unmanaged.txtar b/pkg/cmd/testdata/scripts/unmanaged.txtar index 4c130dd71f9..7c5f4ae550e 100644 --- a/pkg/cmd/testdata/scripts/unmanaged.txtar +++ b/pkg/cmd/testdata/scripts/unmanaged.txtar @@ -27,8 +27,16 @@ cmp stdout golden/unmanaged-with-some-managed # test that chezmoi unmanaged with absent paths should fail ! exec chezmoi unmanaged $HOME${/}absent-path +# test chezmoi unmanaged --path-style=absolute +[!windows] exec chezmoi unmanaged --path-style=absolute +[!windows] cmpenv stdout golden/unmanaged-absolute + -- golden/unmanaged -- .local +-- golden/unmanaged-absolute -- +$WORK/home/user/.dir +$WORK/home/user/.file +$WORK/home/user/.local -- golden/unmanaged-dir -- .dir .local diff --git a/pkg/cmd/unmanagedcmd.go b/pkg/cmd/unmanagedcmd.go index f002656e571..2f9ed73bf8f 100644 --- a/pkg/cmd/unmanagedcmd.go +++ b/pkg/cmd/unmanagedcmd.go @@ -1,6 +1,7 @@ package cmd import ( + "fmt" "io/fs" "sort" "strings" @@ -12,6 +13,10 @@ import ( "github.com/twpayne/chezmoi/v2/pkg/chezmoi" ) +type unmanagedCmdConfig struct { + pathStyle pathStyle +} + func (c *Config) newUnmanagedCmd() *cobra.Command { unmanagedCmd := &cobra.Command{ Use: "unmanaged [path]...", @@ -22,6 +27,13 @@ func (c *Config) newUnmanagedCmd() *cobra.Command { RunE: c.makeRunEWithSourceState(c.runUnmanagedCmd), } + flags := unmanagedCmd.Flags() + flags.VarP(&c.unmanaged.pathStyle, "path-style", "p", "Path style") + + if err := unmanagedCmd.RegisterFlagCompletionFunc("path-style", pathStyleFlagCompletionFunc); err != nil { + panic(err) + } + return unmanagedCmd } @@ -76,8 +88,12 @@ func (c *Config) runUnmanagedCmd(cmd *cobra.Command, args []string, sourceState sortedRelPaths := chezmoi.RelPaths(maps.Keys(unmanagedRelPaths)) sort.Sort(sortedRelPaths) for _, relPath := range sortedRelPaths { - builder.WriteString(relPath.String()) - builder.WriteByte('\n') + switch c.unmanaged.pathStyle { + case pathStyleAbsolute: + fmt.Fprintln(&builder, c.DestDirAbsPath.Join(relPath)) + case pathStyleRelative: + fmt.Fprintln(&builder, relPath) + } } return c.writeOutputString(builder.String()) }
feat
Add --path-style option to managed and unmanaged commands
769b4f0ed215467acaa8608f33fc25eac4b32900
2022-06-16 05:43:01
Tom Payne
chore: Update google/btree dependency
false
diff --git a/go.mod b/go.mod index dade9c6ddf6..f07c7682063 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( go.uber.org/multierr v1.8.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f - golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 + golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 gopkg.in/yaml.v3 v3.0.1 howett.net/plist v1.0.0 @@ -60,7 +60,7 @@ require ( github.com/go-git/go-billy/v5 v5.3.1 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/btree v1.0.1 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/css v1.0.0 // indirect @@ -99,7 +99,7 @@ require ( github.com/yuin/goldmark-emoji v1.0.1 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/net v0.0.0-20220614195744-fb05da6f9022 // indirect + golang.org/x/net v0.0.0-20220615171555-694bf12d69de // 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 @@ -110,7 +110,3 @@ require ( ) exclude github.com/sergi/go-diff v1.2.0 // Produces incorrect diffs - -exclude github.com/google/btree v1.1.0 // https://github.com/google/btree/pull/48 - -exclude github.com/google/btree v1.1.1 // https://github.com/google/btree/pull/48 diff --git a/go.sum b/go.sum index 90f59fbb8e1..9c4501fc3d2 100644 --- a/go.sum +++ b/go.sum @@ -265,8 +265,8 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +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= @@ -762,8 +762,8 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220614195744-fb05da6f9022 h1:0qjDla5xICC2suMtyRH/QqX3B1btXTfNsIt/i4LFgO0= -golang.org/x/net v0.0.0-20220614195744-fb05da6f9022/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220615171555-694bf12d69de h1:ogOG2+P6LjO2j55AkRScrkB2BFpd+Z8TY2wcM0Z3MGo= +golang.org/x/net v0.0.0-20220615171555-694bf12d69de/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 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= @@ -888,8 +888,8 @@ golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 h1:PgOr27OhUx2IRqGJ2RxAWI4dJQ7bi9cSrB82uzFzfUA= -golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/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/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
chore
Update google/btree dependency
e16dab45a12612c63b59408999954b703b2af717
2022-11-23 04:56:28
Tom Payne
feat: Build Arch Linux packages
false
diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6f3682c5757..22cd99c5a47 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -131,6 +131,7 @@ nfpms: description: Manage your dotfiles across multiple diverse machines, securely. license: MIT formats: + - archlinux - deb - rpm dependencies: diff --git a/assets/chezmoi.io/docs/install.md.tmpl b/assets/chezmoi.io/docs/install.md.tmpl index de923e82b9b..7d215270838 100644 --- a/assets/chezmoi.io/docs/install.md.tmpl +++ b/assets/chezmoi.io/docs/install.md.tmpl @@ -186,6 +186,12 @@ Download a package for your distribution and architecture. [`{{ $arch }}`](https://github.com/twpayne/chezmoi/releases/download/v{{ $version }}/chezmoi_{{ $version }}_linux_{{ $arch }}.apk) {{- end }} +=== "Arch Linux" + +{{ range $arch := list "386" "amd64" "arm" "arm64" "loong64" "mips64_hardfloat" "mips64le_hardfloat" "ppc64" "ppc64le" "riscv64" "s390x" }} + [`{{ $arch }}`](https://github.com/twpayne/chezmoi/releases/download/v{{ $version }}/chezmoi_{{ $version }}_linux_{{ $arch }}.pkg.tar.zst) +{{- end }} + ## Download a pre-built binary Download an archive for your operating system and architecture containing a
feat
Build Arch Linux packages
e27270b599aa11783581576d2d46aa1db8096417
2023-06-20 04:21:05
Tom Payne
chore: Tidy up Github Actions
false
diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 0a2a8013c05..14f5fa7060d 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -10,7 +10,7 @@ jobs: - name: go-version id: go-version run: | - echo go-version="$(awk '/GO_VERSION:/ { print $2 }' .github/workflows/main.yml | tr -d \')" >> ${GITHUB_OUTPUT} + echo go-version="$(awk '/GO_VERSION:/ { print $2 }' .github/workflows/main.yml | tr -d \')" >> "${GITHUB_OUTPUT}" - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ steps.go-version.outputs.go-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index edadd26476b..0f30b108960 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -138,8 +138,8 @@ jobs: go run . --version - 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 - + 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 - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - name: test @@ -168,8 +168,8 @@ jobs: go run . --version - 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 - + 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 - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - name: test @@ -194,8 +194,8 @@ jobs: sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft # https://github.com/goreleaser/goreleaser/issues/1715 # https://bugs.launchpad.net/snapcraft/+bug/1889741 - mkdir -p $HOME/.cache/snapcraft/download - mkdir -p $HOME/.cache/snapcraft/stage-packages + mkdir -p "${HOME}/.cache/snapcraft/download" + mkdir -p "${HOME}/.cache/snapcraft/stage-packages" - name: create-syso run: | make create-syso @@ -248,8 +248,8 @@ jobs: - name: install-age if: github.event_name == 'push' || needs.changes.outputs.code == 'true' 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 - + 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 - sudo install -m 755 age/age /usr/local/bin sudo install -m 755 age/age-keygen /usr/local/bin - name: build @@ -349,7 +349,7 @@ jobs: go run ./internal/cmds/lint-whitespace - name: lint-txtar run: | - find . -name \*.txtar | xargs go run ./internal/cmds/lint-txtar + find . -name '*.txtar' -print0 | xargs -0 go run ./internal/cmds/lint-txtar - name: findtypos run: | go install github.com/twpayne/[email protected] @@ -391,8 +391,8 @@ jobs: sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft # https://github.com/goreleaser/goreleaser/issues/1715 # https://bugs.launchpad.net/snapcraft/+bug/1889741 - mkdir -p $HOME/.cache/snapcraft/download - mkdir -p $HOME/.cache/snapcraft/stage-packages + mkdir -p "${HOME}/.cache/snapcraft/download" + mkdir -p "${HOME}/.cache/snapcraft/stage-packages" - name: check-snapcraft-credentials run: snapcraft whoami env:
chore
Tidy up Github Actions
c56a27daed931d7f8fc748e54227e8eb8c3da9c8
2025-03-17 05:11:08
Tom Payne
feat: Set LESS and LV env vars the same way that git does
false
diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 76f26818b17..c4c4c00a979 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -1426,6 +1426,15 @@ func (c *Config) getDiffPagerCmd() (*exec.Cmd, error) { } pagerCmd.Stdout = c.stdout pagerCmd.Stderr = c.stderr + // If the LESS or LV environment variables are not set, set them to sensible + // defaults the same way the git does. See + // https://git-scm.com/docs/git-config#Documentation/git-config.txt-corepager. + if _, ok := os.LookupEnv("LESS"); !ok { + pagerCmd.Env = append(pagerCmd.Environ(), "LESS=FRX") + } + if _, ok := os.LookupEnv("LV"); !ok { + pagerCmd.Env = append(pagerCmd.Environ(), "LV=-c") + } return pagerCmd, nil }
feat
Set LESS and LV env vars the same way that git does
2caee3df62bb9e9d04c63d060f29e0c15eb33b9a
2022-02-02 04:19:39
Tom Payne
docs: Add section on github.com/tuh8888/chezmoi.el
false
diff --git a/assets/chezmoi.io/docs/user-guide/tools/editor.md b/assets/chezmoi.io/docs/user-guide/tools/editor.md index 6c65affc0a1..8d8d8d5e678 100644 --- a/assets/chezmoi.io/docs/user-guide/tools/editor.md +++ b/assets/chezmoi.io/docs/user-guide/tools/editor.md @@ -37,3 +37,9 @@ Put the following in your `.vimrc`: ```vim title="~/.vimrc" autocmd BufWritePost ~/.local/share/chezmoi/* ! chezmoi apply --source-path "%" ``` + +## Use chezmoi with emacs + +[`github.com/tuh8888/chezmoi.el`](https://github.com/tuh8888/chezmoi.el) +provides convenience functions for interacting with chezmoi from emacs, and is +available in [MELPA](https://melpa.org/#/chezmoi).
docs
Add section on github.com/tuh8888/chezmoi.el
a5a982f58850ea5cb22b43ea537c1574a29f8ede
2024-04-30 03:04:04
Tom Payne
chore: Fix file exists errors when running golangci-lint GitHub Action
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e00406afc0..874a80013f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -373,9 +373,6 @@ jobs: contents: read steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version: ${{ env.GO_VERSION }} - uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 with: version: v${{ env.GOLANGCI_LINT_VERSION }}
chore
Fix file exists errors when running golangci-lint GitHub Action
28ebfec7576af7d16e4d571a941068d2f7846cd6
2024-08-07 19:08:55
Tom Payne
fix: Ignore permission changes in re-add command on Windows
false
diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 809097a5da9..172f80cee85 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -321,6 +321,16 @@ func isEmpty(data []byte) bool { return len(bytes.TrimSpace(data)) == 0 } +// isPrivate returns if fileInfo is private. +func isPrivate(fileInfo fs.FileInfo) bool { + return fileInfo.Mode().Perm()&0o77 == 0 +} + +// isReadOnly returns if fileInfo is read-only. +func isReadOnly(fileInfo fs.FileInfo) bool { + return fileInfo.Mode().Perm()&0o222 == 0 +} + // md5Sum returns the MD5 sum of data. func md5Sum(data []byte) []byte { md5SumArr := md5.Sum(data) //nolint:gosec diff --git a/internal/chezmoi/chezmoi_unix.go b/internal/chezmoi/chezmoi_unix.go index e4033b44afe..18c2e403734 100644 --- a/internal/chezmoi/chezmoi_unix.go +++ b/internal/chezmoi/chezmoi_unix.go @@ -31,13 +31,3 @@ func IsExecutable(fileInfo fs.FileInfo) bool { func UserHomeDir() (string, error) { return os.UserHomeDir() } - -// isPrivate returns if fileInfo is private. -func isPrivate(fileInfo fs.FileInfo) bool { - return fileInfo.Mode().Perm()&0o77 == 0 -} - -// isReadOnly returns if fileInfo is read-only. -func isReadOnly(fileInfo fs.FileInfo) bool { - return fileInfo.Mode().Perm()&0o222 == 0 -} diff --git a/internal/chezmoi/chezmoi_windows.go b/internal/chezmoi/chezmoi_windows.go index f196e3fc9c7..17b29b8015f 100644 --- a/internal/chezmoi/chezmoi_windows.go +++ b/internal/chezmoi/chezmoi_windows.go @@ -32,6 +32,9 @@ func findExecutableExtensions(path string) []string { // in the PATHEXT environment variable as per // https://www.nextofwindows.com/what-is-pathext-environment-variable-in-windows. func IsExecutable(fileInfo fs.FileInfo) bool { + if fileInfo.Mode().Perm()&0o111 != 0 { + return true + } if !fileInfo.Mode().IsRegular() { return false } @@ -55,16 +58,6 @@ func UserHomeDir() (string, error) { return os.UserHomeDir() } -// isPrivate returns false on Windows. -func isPrivate(_ fs.FileInfo) bool { - return false -} - -// isReadOnly returns false on Windows. -func isReadOnly(_ fs.FileInfo) bool { - return false -} - // isSlash returns if c is a slash character. func isSlash(c byte) bool { return c == '\\' || c == '/' diff --git a/internal/cmd/readdcmd.go b/internal/cmd/readdcmd.go index edf0e365439..674c174030e 100644 --- a/internal/cmd/readdcmd.go +++ b/internal/cmd/readdcmd.go @@ -4,7 +4,9 @@ import ( "bytes" "fmt" "io/fs" + "runtime" "sort" + "time" "github.com/spf13/cobra" @@ -16,6 +18,23 @@ type reAddCmdConfig struct { recursive bool } +// A fileInfo is a simple struct that implements the io/fs.FileInfo interface +// for the purpose of overriding the mode on Windows. +type fileInfo struct { + name string + size int64 + mode fs.FileMode + modTime time.Time + isDir bool +} + +func (fi *fileInfo) Name() string { return fi.name } +func (fi *fileInfo) Size() int64 { return fi.size } +func (fi *fileInfo) Mode() fs.FileMode { return fi.mode } +func (fi *fileInfo) ModTime() time.Time { return fi.modTime } +func (fi *fileInfo) IsDir() bool { return fi.isDir } +func (fi *fileInfo) Sys() any { return nil } // Sys always returns nil to avoid any inconsistency. + func (c *Config) newReAddCmd() *cobra.Command { reAddCmd := &cobra.Command{ Use: "re-add", @@ -105,8 +124,15 @@ TARGET_REL_PATH: if err != nil { return err } - if bytes.Equal(actualContents, targetContents) && actualStateFile.Perm() == targetStateFile.Perm(c.Umask) { - continue + if bytes.Equal(actualContents, targetContents) { + // On Windows, ignore permission changes as they are not preserved + // by the filesystem. On other systems, if there are no permission + // changes, continue. + // + // See https://github.com/twpayne/chezmoi/issues/3891. + if runtime.GOOS == "windows" || actualStateFile.Perm() == targetStateFile.Perm(c.Umask) { + continue + } } if c.interactive { @@ -140,6 +166,21 @@ TARGET_REL_PATH: } } + // On Windows, as the file mode is not preserved by the filesystem, copy + // the existing mode from the target file. Hack this in by replacing the + // io/fs.FileInfo of the destination file with a new io/fs.FileInfo with + // the mode of the target file. + // + // See https://github.com/twpayne/chezmoi/issues/3891. + if runtime.GOOS == "windows" { + destAbsPathInfo = &fileInfo{ + name: destAbsPathInfo.Name(), + size: destAbsPathInfo.Size(), + mode: targetStateFile.Perm(0), // Use the mode from the target. + modTime: destAbsPathInfo.ModTime(), + } + } + destAbsPathInfos := map[chezmoi.AbsPath]fs.FileInfo{ destAbsPath: destAbsPathInfo, } diff --git a/internal/cmd/readdcmd_test.go b/internal/cmd/readdcmd_test.go new file mode 100644 index 00000000000..3798a8458ed --- /dev/null +++ b/internal/cmd/readdcmd_test.go @@ -0,0 +1,40 @@ +package cmd + +import ( + "io/fs" + "runtime" + "testing" + + "github.com/alecthomas/assert/v2" + "github.com/twpayne/go-vfs/v5" + "github.com/twpayne/go-vfs/v5/vfst" + + "github.com/twpayne/chezmoi/v2/internal/chezmoitest" +) + +var _ fs.FileInfo = &fileInfo{} + +func TestIssue3891(t *testing.T) { + if runtime.GOOS != "windows" { + t.Skip("Windows only") + } + + chezmoitest.WithTestFS(t, map[string]any{ + "/home/user": map[string]any{ + "run.sh": "#!/bin/sh\n", + ".local/share/chezmoi": map[string]any{ + "executable_run.sh": "#!/bin/sh", + }, + }, + }, func(fileSystem vfs.FS) { + assert.NoError(t, newTestConfig(t, fileSystem).execute([]string{"re-add"})) + vfst.RunTests(t, fileSystem, "", + vfst.TestPath("/home/user/.local/share/chezmoi/executable_run.sh", + vfst.TestContentsString("#!/bin/sh\n"), + ), + vfst.TestPath("/home/user/.local/share/chezmoi/run.sh", + vfst.TestDoesNotExist(), + ), + ) + }) +} diff --git a/internal/cmd/testdata/scripts/issue3891.txtar b/internal/cmd/testdata/scripts/issue3891.txtar new file mode 100644 index 00000000000..d32e12eb47d --- /dev/null +++ b/internal/cmd/testdata/scripts/issue3891.txtar @@ -0,0 +1,10 @@ +[!windows] skip 'Windows only' + +# test that chezmoi re-add does not remove the executable_ attribute on Windows +exec chezmoi apply +exec chezmoi re-add --debug +exists $CHEZMOISOURCEDIR/executable_run.sh +! exists $CHEZMOISOURCEDIR/run.sh + +-- home/user/.local/share/chezmoi/executable_run.sh -- +#!/bin/sh
fix
Ignore permission changes in re-add command on Windows
ffdc74666c39f375cf2d348a07b3912492f72bbf
2022-08-12 17:37:27
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 3f3ceafa588..6cbf191d7af 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.18 require ( filippo.io/age v1.0.0 github.com/Masterminds/sprig/v3 v3.2.2 - github.com/aws/aws-sdk-go-v2 v1.16.8 - github.com/aws/aws-sdk-go-v2/config v1.15.15 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.14 + github.com/aws/aws-sdk-go-v2 v1.16.11 + github.com/aws/aws-sdk-go-v2/config v1.16.1 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.17 github.com/bmatcuk/doublestar/v4 v4.2.0 github.com/bradenhilton/mozillainstallhash v1.0.0 github.com/charmbracelet/glamour v0.5.0 @@ -35,9 +35,10 @@ 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-20220722155238-128564f6959c + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e + golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 - golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 + golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 gopkg.in/yaml.v3 v3.0.1 howett.net/plist v1.0.0 @@ -48,19 +49,19 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20220730123233-d6ffb7692adf // indirect + github.com/ProtonMail/go-crypto v0.0.0-20220812102039-7f02a4f046af // indirect 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.10 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.13 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.10 // indirect - github.com/aws/smithy-go v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.13 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect + github.com/aws/smithy-go v1.12.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradenhilton/cityhash v1.0.0 // indirect github.com/cloudflare/circl v1.2.0 // indirect @@ -80,7 +81,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -109,15 +110,14 @@ require ( github.com/xanzy/ssh-agent v0.3.1 // indirect github.com/yuin/goldmark v1.4.13 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect - go.uber.org/atomic v1.9.0 // indirect + go.uber.org/atomic v1.10.0 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect + golang.org/x/net v0.0.0-20220811182439-13a9a731de15 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/errgo.v2 v2.1.0 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index fcb1b744853..f56c394245e 100644 --- a/go.sum +++ b/go.sum @@ -17,20 +17,7 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb 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.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -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/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -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= 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= @@ -38,19 +25,11 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM 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= @@ -63,18 +42,15 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX 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= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= @@ -86,62 +62,46 @@ github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugX github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/ProtonMail/go-crypto v0.0.0-20220730123233-d6ffb7692adf h1:aFFtnGZ6/2Qlvx80yxA2fFSYDQWTFjtKozQKB36A3/A= -github.com/ProtonMail/go-crypto v0.0.0-20220730123233-d6ffb7692adf/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= +github.com/ProtonMail/go-crypto v0.0.0-20220812102039-7f02a4f046af h1:o388RXRJJhhPJxKA4gEtUx2hX8NHwUssZK9PsKV+FpE= +github.com/ProtonMail/go-crypto v0.0.0-20220812102039-7f02a4f046af/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -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.8 h1:gOe9UPR98XSf7oEJCcojYg+N2/jCRm4DdeIsP85pIyQ= -github.com/aws/aws-sdk-go-v2 v1.16.8/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw= -github.com/aws/aws-sdk-go-v2/config v1.15.15 h1:yBV+J7Au5KZwOIrIYhYkTGJbifZPCkAnCFSvGsF3ui8= -github.com/aws/aws-sdk-go-v2/config v1.15.15/go.mod h1:A1Lzyy/o21I5/s2FbyX5AevQfSVXpvvIDCoVFD0BC4E= -github.com/aws/aws-sdk-go-v2/credentials v1.12.10 h1:7gGcMQePejwiKoDWjB9cWnpfVdnz/e5JwJFuT6OrroI= -github.com/aws/aws-sdk-go-v2/credentials v1.12.10/go.mod h1:g5eIM5XRs/OzIIK81QMBl+dAuDyoLN0VYaLP+tBqEOk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9 h1:hz8tc+OW17YqxyFFPSkvfSikbqWcyyHRyPVSTzC0+aI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9/go.mod h1:KDCCm4ONIdHtUloDcFvK2+vshZvx4Zmj7UMDfusuz5s= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15 h1:bx5F2mr6H6FC7zNIQoDoUr8wEKnvmwRncujT3FYRtic= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15/go.mod h1:pWrr2OoHlT7M/Pd2y4HV3gJyPb3qj5qMmnPkKSNPYK4= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9 h1:5sbyznZC2TeFpa4fvtpvpcGbzeXEEs1l1Jo51ynUNsQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9/go.mod h1:08tUpeSGN33QKSO7fwxXczNfiwCpbj+GxK6XKwqWVv0= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16 h1:f0ySVcmQhwmzn7zQozd8wBM3yuGBfzdpsOaKQ0/Epzw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16/go.mod h1:CYmI+7x03jjJih8kBEEFKRQc40UjUokT0k7GbvrhhTc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9 h1:sHfDuhbOuuWSIAEDd3pma6p0JgUcR2iePxtCE8gfCxQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9/go.mod h1:yQowTpvdZkFVuHrLBXmczat4W+WJKg/PafBZnGBLga0= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.14 h1:dvvIB9OYsOH10RUNAY7yiCq5fQwGebXx1auBOkBTUlg= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.14/go.mod h1:xakbH8KMsQQKqzX87uyyzTHshc/0/Df8bsTneTS5pFU= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.13 h1:DQpf+al+aWozOEmVEdml67qkVZ6vdtGUi71BZZWw40k= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.13/go.mod h1:d7ptRksDDgvXaUvxyHZ9SYh+iMDymm94JbVcgvSYSzU= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.10 h1:7tquJrhjYz2EsCBvA9VTl+sBAAh1bv7h/sGASdZOGGo= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.10/go.mod h1:cftkHYN6tCDNfkSasAmclSfl4l7cySoay8vz7p/ce0E= -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/aws/aws-sdk-go-v2 v1.16.11 h1:xM1ZPSvty3xVmdxiGr7ay/wlqv+MWhH0rMlyLdbC0YQ= +github.com/aws/aws-sdk-go-v2 v1.16.11/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo= +github.com/aws/aws-sdk-go-v2/config v1.16.1 h1:jasqFPOoNPXHOYGEEuvyT87ACiXhD3OkQckIm5uqi5I= +github.com/aws/aws-sdk-go-v2/config v1.16.1/go.mod h1:4SKzBMiB8lV0fw2w7eDBo/LjQyHFITN4vUUuqpurFmI= +github.com/aws/aws-sdk-go-v2/credentials v1.12.13 h1:cuPzIsjKAWBUAAk8ZUR2l02Sxafl9hiaMsc7tlnjwAY= +github.com/aws/aws-sdk-go-v2/credentials v1.12.13/go.mod h1:9fDEemXizwXrxPU1MTzv69LP/9D8HVl5qHAQO9A9ikY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 h1:wgJBHO58Pc1V1QAnzdVM3JK3WbE/6eUF0JxCZ+/izz0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12/go.mod h1:aZ4vZnyUuxedC7eD4JyEHpGnCz+O2sHQEx3VvAwklSE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 h1:OmiwoVyLKEqqD5GvB683dbSqxiOfvx4U2lDZhG2Esc4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18/go.mod h1:348MLhzV1GSlZSMusdwQpXKbhD7X2gbI/TxwAPKkYZQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 h1:5mvQDtNWtI6H56+E4LUnLWEmATMB7oEh+Z9RurtIuC0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12/go.mod h1:ckaCVTEdGAxO6KwTGzgskxR1xM+iJW4lxMyDFVda2Fc= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 h1:g5qq9sgtEzt2szMaDqQO6fqKe026T6dHTFJp5NsPzkQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19/go.mod h1:cVHo8KTuHjShb9V8/VjH3S/8+xPu16qx8fdGwmotJhE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 h1:7iPTTX4SAI2U2VOogD7/gmHlsgnYSgoNHt7MSQXtG2M= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12/go.mod h1:1TODGhheLWjpQWSuhYuAUWYTCKwEjx2iblIFKDHjeTc= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.17 h1:x4JtJ0TaVVCoNc3bUtv0W5VvMLFiQ1++ReiRfSxRYf8= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.17/go.mod h1:HvF8QZUW+evBsd/SJn4VA0WWW5qVMKxPpWiRRK4w3eM= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.16 h1:YK8L7TNlGwMWHYqLs+i6dlITpxqzq08FqQUy26nm+T8= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.16/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 h1:dl8T0PJlN92rvEGOEUiD0+YPYdPEaCZK0TqHukvSfII= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.13/go.mod h1:Ru3QVMLygVs/07UQ3YDur1AQZZp2tUNje8wfloFttC0= +github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag= +github.com/aws/smithy-go v1.12.1/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= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmatcuk/doublestar/v4 v4.2.0 h1:Qu+u9wR3Vd89LnlLMHvnZ5coJMWKQamqdz9/p5GNthA= github.com/bmatcuk/doublestar/v4 v4.2.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bradenhilton/cityhash v1.0.0 h1:1QauDCwfxwIGwO2jBTJdEBqXgfCusAgQOSgdl4RsTMI= @@ -153,8 +113,6 @@ github.com/bwesterb/go-ristretto v1.2.1 h1:Xd9ZXmjKE2aY8Ub7+4bX7tXsIPsV1pIZaUlJU github.com/bwesterb/go-ristretto v1.2.1/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/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= @@ -163,8 +121,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5O 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/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= @@ -174,22 +130,14 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX 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= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 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= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -199,7 +147,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= @@ -209,24 +156,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m 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= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= @@ -243,29 +180,19 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 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= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -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= github.com/godbus/dbus/v5 v5.0.6/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= -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= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -273,9 +200,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt 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= @@ -291,10 +216,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD 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 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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= @@ -307,7 +230,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -318,7 +240,6 @@ github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FC github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= 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/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= @@ -326,7 +247,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi 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= 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= @@ -338,74 +258,34 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe 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= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU= -github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk= 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/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.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -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= 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/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= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -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= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -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= @@ -416,8 +296,9 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH 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/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 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= @@ -427,37 +308,24 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y 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/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= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 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= @@ -471,17 +339,8 @@ github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamh 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= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -489,34 +348,21 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/microcosm-cc/bluemonday v1.0.19 h1:OI7hoF5FY4pFz2VA//RN8TfM0YJ2dJcl4P4APrCWy6c= github.com/microcosm-cc/bluemonday v1.0.19/go.mod h1:QNzV2UbLK2/53oIIwTOyLUSABMkjZ4tqiyC1g/DyqxE= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= 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.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -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.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 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= 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= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= @@ -524,24 +370,18 @@ github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKt github.com/muesli/termenv v0.9.0/go.mod h1:R/LzAKf+suGs4IsO95y7+7DpFHO0KABgnZqtlyx2mBw= 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= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 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.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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= @@ -549,49 +389,24 @@ 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= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -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= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 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.3.4 h1:3Z3Eu6FGHZWSfNKJTOUiPatWwfc7DzJRU04jFUqJODw= github.com/rivo/uniseg v0.3.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -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.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= @@ -599,14 +414,9 @@ github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H 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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 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/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -628,20 +438,17 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf 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= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -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= github.com/twpayne/go-pinentry v0.2.0/go.mod h1:r6buhMwARxnnL0VRBqfd1tE6Fadk1kfP00GRMutEspY= github.com/twpayne/go-shell v0.3.1 h1:JIC6cyDpG/p8mRnFUleH07roi90q0J9QC8PnvtmYLRo= @@ -663,8 +470,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -677,13 +482,9 @@ github.com/zalando/go-keyring v0.2.1/go.mod h1:g63M2PPn0w5vjmEbwAX3ib5I+41zdm4es 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= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -691,34 +492,25 @@ 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= -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.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= 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= 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-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -730,7 +522,6 @@ 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/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= @@ -749,7 +540,6 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI 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= @@ -760,12 +550,10 @@ 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/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= 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-20181114220301-adae6a3d119a/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= @@ -773,11 +561,9 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn 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-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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-20190923162816-aa69164e4478/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= @@ -794,29 +580,14 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R 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-20201224014010-6772e930b67b/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-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/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/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -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-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 h1:N9Vc/rorQUDes6B9CNdIxAn5jODGj2wzfrei2x4wNj4= -golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220811182439-13a9a731de15 h1:cik0bxZUSJVDyaHf1hZPSDsU8SZHGQZQMeueXCE7yBQ= +golang.org/x/net v0.0.0-20220811182439-13a9a731de15/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= 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= @@ -826,20 +597,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ 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-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -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/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/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY= -golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 h1:dtndE8FcEta75/4kHF3AbpuWzV6f1LjnLrM4pe2SZrw= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= 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= @@ -850,38 +609,26 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ 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-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/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-20190422165155-953cdadca894/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-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/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= @@ -892,8 +639,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w 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-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/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-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -904,53 +649,26 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w 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-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/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-20210324051608-47abb6519492/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-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/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-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/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-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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-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-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= -golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/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/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -959,7 +677,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 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 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -980,7 +697,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw 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-20190907020128-2ca718005c18/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-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1005,7 +721,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY 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= @@ -1014,24 +729,14 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f 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.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= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= 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/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= 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= @@ -1051,29 +756,7 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 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.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -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= 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= @@ -1105,7 +788,6 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG 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= @@ -1118,54 +800,8 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D 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-20210108203827-ffc7fda8c3d7/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-20210226172003-ab064af71705/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-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -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= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= 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= @@ -1179,26 +815,10 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji 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.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -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= 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= @@ -1211,11 +831,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= @@ -1224,18 +841,14 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN 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.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/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= 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= -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.5/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= @@ -1256,7 +869,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 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= @@ -1267,4 +879,3 @@ 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=
chore
Update dependencies
b9640d40d6d5001ae8f6bb66c51eedcdafdc34c8
2021-12-23 18:44:22
Tom Payne
chore: Use new {bytes,strings}.Cut functions
false
diff --git a/internal/chezmoi/chezmoi_go1.17.go b/internal/chezmoi/chezmoi_go1.17.go new file mode 100644 index 00000000000..587aa2f551e --- /dev/null +++ b/internal/chezmoi/chezmoi_go1.17.go @@ -0,0 +1,31 @@ +//go:build !go1.18 +// +build !go1.18 + +package chezmoi + +import ( + "bytes" + "strings" +) + +// CutBytes slices s around the first instance of sep, returning the text before +// and after sep. The found result reports whether sep appears in s. If sep does +// not appear in s, cut returns s, nil, false. +// +// CutBytes returns slices of the original slice s, not copies. +func CutBytes(s, sep []byte) (before, after []byte, found bool) { + if i := bytes.Index(s, sep); i >= 0 { + return s[:i], s[i+len(sep):], true + } + return s, nil, false +} + +// CutString slices s around the first instance of sep, returning the text +// before and after sep. The found result reports whether sep appears in s. If +// sep does not appear in s, cut returns s, "", false. +func CutString(s, sep string) (before, after string, found bool) { + if i := strings.Index(s, sep); i >= 0 { + return s[:i], s[i+len(sep):], true + } + return s, "", false +} diff --git a/internal/chezmoi/chezmoi_go1.18.go b/internal/chezmoi/chezmoi_go1.18.go new file mode 100644 index 00000000000..258ff5ebd3f --- /dev/null +++ b/internal/chezmoi/chezmoi_go1.18.go @@ -0,0 +1,16 @@ +//go:build go1.18 +// +build go1.18 + +package chezmoi + +import ( + "bytes" + "strings" +) + +// FIXME when Go 1.18 is the minimum supported Go version, replace these with +// {strings,bytes}.Cut. +var ( + CutBytes = bytes.Cut + CutString = strings.Cut +) diff --git a/internal/chezmoi/chezmoi_unix.go b/internal/chezmoi/chezmoi_unix.go index 653e5f80f0c..663e5126c97 100644 --- a/internal/chezmoi/chezmoi_unix.go +++ b/internal/chezmoi/chezmoi_unix.go @@ -41,9 +41,7 @@ func etcHostnameFQDNHostname(fileSystem vfs.FS) (string, error) { s := bufio.NewScanner(bytes.NewReader(contents)) for s.Scan() { text := s.Text() - if index := strings.IndexByte(text, '#'); index != -1 { - text = text[:index] - } + text, _, _ = CutString(text, "#") if hostname := strings.TrimSpace(text); hostname != "" { return hostname, nil } @@ -61,9 +59,7 @@ func etcHostsFQDNHostname(fileSystem vfs.FS) (string, error) { for s.Scan() { text := s.Text() text = strings.TrimSpace(text) - if index := strings.IndexByte(text, '#'); index != -1 { - text = text[:index] - } + text, _, _ = CutString(text, "#") fields := whitespaceRx.Split(text, -1) if len(fields) >= 2 && fields[0] == "127.0.1.1" { return fields[1], nil diff --git a/internal/chezmoi/data.go b/internal/chezmoi/data.go index 75901ec5480..fab27dab723 100644 --- a/internal/chezmoi/data.go +++ b/internal/chezmoi/data.go @@ -94,13 +94,11 @@ func parseOSRelease(r io.Reader) (map[string]interface{}, error) { if len(token) == 0 || token[0] == '#' { continue } - fields := strings.SplitN(token, "=", 2) - if len(fields) != 2 { + key, value, ok := CutString(token, "=") + if !ok { return nil, fmt.Errorf("%s: parse error", token) } - key := fields[0] - value := maybeUnquote(fields[1]) - result[key] = value + result[key] = maybeUnquote(value) } return result, s.Err() } diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index fb2a415f26d..ad787058609 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -1053,9 +1053,7 @@ func (s *SourceState) addPatterns(patternSet *patternSet, sourceAbsPath AbsPath, for scanner.Scan() { lineNumber++ text := scanner.Text() - if index := strings.IndexRune(text, '#'); index != -1 { - text = text[:index] - } + text, _, _ = CutString(text, "#") text = strings.TrimSpace(text) if text == "" { continue diff --git a/internal/cmd/config.go b/internal/cmd/config.go index b82b481037b..22eb7396966 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -908,7 +908,7 @@ func (c *Config) defaultTemplateData() map[string]interface{} { var hostname string if rawHostname, err := os.Hostname(); err == nil { - hostname = strings.SplitN(rawHostname, ".", 2)[0] + hostname, _, _ = chezmoi.CutString(rawHostname, "=") } else { c.logger.Info(). Err(err). diff --git a/internal/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go index af4824faad4..14849767b74 100644 --- a/internal/cmd/doctorcmd.go +++ b/internal/cmd/doctorcmd.go @@ -357,7 +357,7 @@ func (c *binaryCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) } version, err := semver.NewVersion(string(versionBytes)) if err != nil { - return checkResultFailed, fmt.Sprintf("version %s: %s", versionBytes, err) + return checkResultFailed, err.Error() } if c.minVersion != nil && version.LessThan(*c.minVersion) { diff --git a/internal/cmd/githubtemplatefuncs.go b/internal/cmd/githubtemplatefuncs.go index 2127f1dfad9..7ed27e6aff8 100644 --- a/internal/cmd/githubtemplatefuncs.go +++ b/internal/cmd/githubtemplatefuncs.go @@ -3,9 +3,10 @@ package cmd import ( "context" "fmt" - "strings" "github.com/google/go-github/v41/github" + + "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type gitHubData struct { @@ -87,11 +88,10 @@ func (c *Config) gitHubLatestReleaseTemplateFunc(userRepo string) *github.Reposi } func parseGitHubUserRepo(userRepo string) (string, string) { - fields := strings.SplitN(userRepo, "/", 2) - if len(fields) != 2 || fields[0] == "" || fields[1] == "" { + user, repo, ok := chezmoi.CutString(userRepo, "/") + if !ok { returnTemplateError(fmt.Errorf("%s: not a user/repo", userRepo)) return "", "" } - user, repo := fields[0], fields[1] return user, repo } diff --git a/internal/cmd/gopasstemplatefuncs.go b/internal/cmd/gopasstemplatefuncs.go index 366ad883b27..a96eb486427 100644 --- a/internal/cmd/gopasstemplatefuncs.go +++ b/internal/cmd/gopasstemplatefuncs.go @@ -1,12 +1,13 @@ package cmd import ( - "bytes" "fmt" "os/exec" "regexp" "github.com/coreos/go-semver/semver" + + "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) var ( @@ -85,12 +86,8 @@ func (c *Config) gopassTemplateFunc(id string) string { return "" } - var password string - if index := bytes.IndexByte(output, '\n'); index != -1 { - password = string(output[:index]) - } else { - password = string(output) - } + passwordBytes, _, _ := chezmoi.CutBytes(output, []byte{'\n'}) + password := string(passwordBytes) if c.Gopass.cache == nil { c.Gopass.cache = make(map[string]string) diff --git a/internal/cmd/passtemplatefuncs.go b/internal/cmd/passtemplatefuncs.go index 880e97f3827..90c3011fa05 100644 --- a/internal/cmd/passtemplatefuncs.go +++ b/internal/cmd/passtemplatefuncs.go @@ -1,9 +1,10 @@ package cmd import ( - "bytes" "fmt" "os/exec" + + "github.com/twpayne/chezmoi/v2/internal/chezmoi" ) type passConfig struct { @@ -36,10 +37,7 @@ func (c *Config) passOutput(id string) []byte { } func (c *Config) passTemplateFunc(id string) string { - output := c.passOutput(id) - if index := bytes.IndexByte(output, '\n'); index != -1 { - return string(output[:index]) - } + output, _, _ := chezmoi.CutBytes(c.passOutput(id), []byte{'\n'}) return string(output) }
chore
Use new {bytes,strings}.Cut functions
0d786962d9d345d7c074689c48d32f2ba6ada067
2022-06-20 02:10:35
Tom Payne
chore: Remove unused function
false
diff --git a/pkg/cmd/util.go b/pkg/cmd/util.go index 532e1c31703..08f228418bf 100644 --- a/pkg/cmd/util.go +++ b/pkg/cmd/util.go @@ -6,13 +6,9 @@ import ( "strconv" "strings" "unicode" - - "github.com/coreos/go-semver/semver" ) var ( - goVersionRx = regexp.MustCompile(`\Ago(\d+)(?:\.(\d+)(?:\.(\d+))?)?\z`) - wellKnownAbbreviations = map[string]struct{}{ "ANSI": {}, "CPE": {}, @@ -28,21 +24,6 @@ var ( } ) -func ParseGoVersion(goVersion string) (*semver.Version, error) { - m := goVersionRx.FindStringSubmatch(goVersion) - if m == nil { - return nil, fmt.Errorf("%s: invalid Go version", goVersion) - } - major, _ := strconv.ParseInt(m[1], 10, 64) - minor, _ := strconv.ParseInt(m[2], 10, 64) - patch, _ := strconv.ParseInt(m[3], 10, 64) - return &semver.Version{ - Major: major, - Minor: minor, - Patch: patch, - }, nil -} - // englishList returns ss formatted as a list, including an Oxford comma. func englishList(ss []string) string { switch n := len(ss); n { diff --git a/pkg/cmd/util_test.go b/pkg/cmd/util_test.go index 36621f96e4b..8e0379dd93e 100644 --- a/pkg/cmd/util_test.go +++ b/pkg/cmd/util_test.go @@ -4,7 +4,6 @@ import ( "strings" "testing" - "github.com/coreos/go-semver/semver" "github.com/stretchr/testify/assert" ) @@ -111,28 +110,6 @@ func TestEnglishListWithNoun(t *testing.T) { } } -func TestParseGoVersion(t *testing.T) { - for _, tc := range []struct { - goVersion string - expected *semver.Version - }{ - { - goVersion: "go1.17", - expected: semver.Must(semver.NewVersion("1.17.0")), - }, - { - goVersion: "go1.17.5", - expected: semver.Must(semver.NewVersion("1.17.5")), - }, - } { - t.Run(tc.goVersion, func(t *testing.T) { - actual, err := ParseGoVersion(tc.goVersion) - assert.NoError(t, err) - assert.Equal(t, tc.expected, actual) - }) - } -} - func TestUniqueAbbreviations(t *testing.T) { for _, tc := range []struct { values []string
chore
Remove unused function
d23b428ef2ab10f67e64057a27f616543e831628
2021-11-29 17:20:24
Tom Payne
fix: Check for .chezmoiversion outside .chezmoiroot
false
diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 3cff6ef8635..2c5e20cbc69 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -51,13 +51,13 @@ const ( Prefix = ".chezmoi" RootName = Prefix + "root" + VersionName = Prefix + "version" dataName = Prefix + "data" externalName = Prefix + "external" ignoreName = Prefix + "ignore" removeName = Prefix + "remove" scriptsDirName = Prefix + "scripts" templatesDirName = Prefix + "templates" - versionName = Prefix + "version" ) var ( @@ -80,7 +80,7 @@ var knownPrefixedFiles = newStringSet( externalName+".yaml", ignoreName, removeName, - versionName, + VersionName, ) var modeTypeNames = map[fs.FileMode]string{ diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index a5a0363761e..1eeca33e152 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -144,6 +144,15 @@ func WithLogger(logger *zerolog.Logger) SourceStateOption { } } +// WithMinVersion sets the minimum version. +func WithMinVersion(minVersion *semver.Version) SourceStateOption { + return func(s *SourceState) { + if minVersion != nil && s.minVersion.LessThan(*minVersion) { + s.minVersion = *minVersion + } + } +} + // WithMode sets the mode. func WithMode(mode Mode) SourceStateOption { return func(s *SourceState) { @@ -791,7 +800,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { return err } return vfs.SkipDir - case fileInfo.Name() == versionName: + case fileInfo.Name() == VersionName: return s.addVersionFile(sourceAbsPath) case strings.HasPrefix(fileInfo.Name(), Prefix): fallthrough diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 92e4de49507..4310eb099e5 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -1360,6 +1360,19 @@ func (c *Config) newSourceState( sourceStateLogger := c.logger.With().Str(logComponentKey, logComponentValueSourceState).Logger() + versionAbsPath := c.SourceDirAbsPath.JoinString(chezmoi.VersionName) + var minVersion *semver.Version + switch data, err := c.baseSystem.ReadFile(versionAbsPath); { + case errors.Is(err, fs.ErrNotExist): + case err != nil: + return nil, err + default: + minVersion, err = semver.NewVersion(strings.TrimSpace(string(data))) + if err != nil { + return nil, fmt.Errorf("%s: %w", versionAbsPath, err) + } + } + sourceDirAbsPath, err := c.sourceDirAbsPath() if err != nil { return nil, err @@ -1374,6 +1387,7 @@ func (c *Config) newSourceState( chezmoi.WithHTTPClient(httpClient), chezmoi.WithInterpreters(c.Interpreters), chezmoi.WithLogger(&sourceStateLogger), + chezmoi.WithMinVersion(minVersion), chezmoi.WithMode(c.Mode), chezmoi.WithPriorityTemplateData(c.Data), chezmoi.WithSourceDir(sourceDirAbsPath), diff --git a/internal/cmd/testdata/scripts/errors.txt b/internal/cmd/testdata/scripts/errors.txt index 61163f915f2..0085192dd85 100644 --- a/internal/cmd/testdata/scripts/errors.txt +++ b/internal/cmd/testdata/scripts/errors.txt @@ -24,6 +24,11 @@ chhome home4/user stderr 'source state requires version' chhome home5/user +# test that chezmoi checks .chezmoiversion when .chezmoiroot is used +! chezmoi verify +stderr 'source state requires version' + +chhome home6/user # test duplicate script detection ! chezmoi verify @@ -37,7 +42,11 @@ stderr 'inconsistent state' # contents of .local/share/chezmoi -- home4/user/.local/share/chezmoi/.chezmoiversion -- 3.0.0 --- home5/user/.local/share/chezmoi/run_install_packages -- +-- home5/user/.local/share/chezmoi/.chezmoiversion -- +3.0.0 +-- home5/user/.local/share/chezmoi/.chezmoiroot -- +home +-- home6/user/.local/share/chezmoi/run_install_packages -- # contents of install_packages --- home5/user/.local/share/chezmoi/run_once_install_packages -- +-- home6/user/.local/share/chezmoi/run_once_install_packages -- # contents of install_packages
fix
Check for .chezmoiversion outside .chezmoiroot
4b299c1450ded858e85dfac90636558f9f007d15
2022-09-13 00:16:17
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 2397dcc7fab..c180c1da3d3 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.18 require ( filippo.io/age v1.0.0 github.com/Masterminds/sprig/v3 v3.2.2 - github.com/aws/aws-sdk-go-v2 v1.16.13 - github.com/aws/aws-sdk-go-v2/config v1.17.4 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.21 + github.com/aws/aws-sdk-go-v2 v1.16.14 + github.com/aws/aws-sdk-go-v2/config v1.17.5 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.22 github.com/bmatcuk/doublestar/v4 v4.2.0 github.com/bradenhilton/mozillainstallhash v1.0.0 github.com/charmbracelet/glamour v0.5.0 @@ -26,7 +26,7 @@ require ( github.com/sergi/go-diff v1.1.0 github.com/spf13/afero v1.9.2 github.com/spf13/cobra v1.5.0 - github.com/spf13/viper v1.12.0 + github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.0 github.com/twpayne/go-pinentry v0.2.0 github.com/twpayne/go-shell v0.3.1 @@ -37,10 +37,10 @@ require ( github.com/zalando/go-keyring v0.2.1 go.etcd.io/bbolt v1.3.7-0.20220226045046-fd5535f71f48 go.uber.org/multierr v1.8.0 - golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 - golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 - golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde - golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 + golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 + golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 + golang.org/x/sync v0.0.0-20220907140024-f12130a52804 + golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v3 v3.0.1 @@ -56,16 +56,16 @@ 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.17 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.20 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.16 // indirect - github.com/aws/smithy-go v1.13.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.18 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.21 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.17 // indirect + github.com/aws/smithy-go v1.13.2 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradenhilton/cityhash v1.0.0 // indirect github.com/cloudflare/circl v1.2.0 // indirect @@ -92,7 +92,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/microcosm-cc/bluemonday v1.0.19 // indirect + github.com/microcosm-cc/bluemonday v1.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -104,18 +104,18 @@ require ( github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.3.4 // indirect + github.com/rivo/uniseg v0.4.2 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/xanzy/ssh-agent v0.3.2 // indirect - github.com/yuin/goldmark v1.4.13 // indirect + github.com/yuin/goldmark v1.4.14 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect go.uber.org/atomic v1.10.0 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect diff --git a/go.sum b/go.sum index d969b782354..592d8bb65b9 100644 --- a/go.sum +++ b/go.sum @@ -75,32 +75,32 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= 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.13 h1:HgF7OX2q0gSZtcXoo9DMEA8A2Qk/GCxmWyM0RI7Yz2Y= -github.com/aws/aws-sdk-go-v2 v1.16.13/go.mod h1:xSyvSnzh0KLs5H4HJGeIEsNYemUWdNIl0b/rP6SIsLU= -github.com/aws/aws-sdk-go-v2/config v1.17.4 h1:9HY1wbShqObySCHP2Z07blfrSWVX+nVxCZmUuLZKcG8= -github.com/aws/aws-sdk-go-v2/config v1.17.4/go.mod h1:ul+ru+huVpfduF9XRmGUq82T8T3K+nIFQuF6F+L+548= -github.com/aws/aws-sdk-go-v2/credentials v1.12.17 h1:htUjIJOQcvIUR0jC4eLkdis1DfaLL4EUbIKUFqh2WFA= -github.com/aws/aws-sdk-go-v2/credentials v1.12.17/go.mod h1:jd1mvJulXY7ccHvcSiJceYhv06yWIIRkJnwWEA4IX+g= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14 h1:NZwZFtxXGOEIiCd8jWN55lexakug543CaO68bTpoLwg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.14/go.mod h1:5CU57SyF5jZLSIw4OOll0PG83ThXwNdkRFOc0EltD/0= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20 h1:Rk8eqZSdFovt8Id+O+i2qT0c3CY13DPn2SfGOEVlxNs= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.20/go.mod h1:gdZ5gRUaxThXIZyZQ8MTtgYBk2jbHgp05BO3GcD9Cwc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14 h1:6Yxuq9yrkoLYab5JXqJnto9tdRuIcYVdR+eiKjsJYWU= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.14/go.mod h1:GEV9jaDPIgayiU+uevxwozcvUOjc+P4aHE2BeSjm2vE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21 h1:lpwSbLKYTuABo6SyUoC25xAmfO3/TehGS2SmD1EtOL0= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.21/go.mod h1:Q0pktZjvRZk77TBto6yAvUAi7fcse1bdcMctBDVGgBw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14 h1:c5hJNN2DkK1gAytcKp7LkiKNDJeevFSboPezEHAM4Ro= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.14/go.mod h1:8qOLjqMzY/S1kh3myDXA1yxK5eD4uN8aOJgKpgvc4OM= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.21 h1:/IRc1VVBx9/04hwGTQW+ud28AKBmcAaIMWAb0uEDt+k= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.21/go.mod h1:6JkZkiwXG3TLJh9O+WysncUbD1hTrsKiSTO1kbYM/MQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.20 h1:3raP0UC9rvRyY4/cc4o4F3jTrNo94AYiarNUGNnq6dU= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.20/go.mod h1:hPsROgDdgY/NQ1gPt7VJWG0GjSnalDC0DkkMfGEw2gc= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2 h1:/SYpdjjAtraymql+/r719OgjxezdanAQiLb/NMxDb04= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.2/go.mod h1:5cxfDYtY2mDOlmesy4yycb6lwyy1U/iAUOHKhQLKw/E= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.16 h1:otZvq9r+xjPL7qU/luX2QdBamiN+oSZURRi4sAKymO8= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.16/go.mod h1:Y9iBgT1w2vHtYzJEkwD6FqILjDSsvbxcW/+wIYxyse4= -github.com/aws/smithy-go v1.13.1 h1:q09BdpUiaqpothcv393ACfWJJHzlzjB5HaNL1XHKmoQ= -github.com/aws/smithy-go v1.13.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go-v2 v1.16.14 h1:db6GvO4Z2UqHt5gvT0lr6J5x5P+oQ7bdRzczVaRekMU= +github.com/aws/aws-sdk-go-v2 v1.16.14/go.mod h1:s/G+UV29dECbF5rf+RNj1xhlmvoNurGSr+McVSRj59w= +github.com/aws/aws-sdk-go-v2/config v1.17.5 h1:+NS1BWvprx7nHcIk5o32LrZgifs/7Pm1V2nWjQgZ2H0= +github.com/aws/aws-sdk-go-v2/config v1.17.5/go.mod h1:H0cvPNDO3uExWts/9PDhD/0ne2esu1uaIulwn1vkwxM= +github.com/aws/aws-sdk-go-v2/credentials v1.12.18 h1:HF62tbhARhgLfvmfwUbL9qZ+dkbZYzbFdxBb3l5gr7Q= +github.com/aws/aws-sdk-go-v2/credentials v1.12.18/go.mod h1:O7n/CPagQ33rfG6h7vR/W02ammuc5CrsSM22cNZp9so= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15 h1:nkQ+aI0OCeYfzrBipL6ja/6VEbUnHQoZHBHtoK+Nzxw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15/go.mod h1:Oz2/qWINxIgSmoZT9adpxJy2UhpcOAI3TIyWgYMVSz0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21 h1:gRIXnmAVNyoRQywdNtpAkgY+f30QNzgF53Q5OobNZZs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21/go.mod h1:XsmHMV9c512xgsW01q7H0ut+UQQQpWX8QsFbdLHDwaU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15 h1:noAhOo2mMDyYhTx99aYPvQw16T3fQ/DiKAv9fzpIKH8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15/go.mod h1:kjJ4CyD9M3Wq88GYg3IPfj67Rs0Uvz8aXK7MJ8BvE4I= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22 h1:nF+E8HfYpOMw6M5oA9efB602VC00IHNQnB5CmFvZPvA= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22/go.mod h1:tltHVGy977LrSOgRR5aV9+miyno/Gul/uJNPKS7FzP4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15 h1:xlf0J6DUgAj/ocvKQxCmad8Bu1lJuRbt5Wu+4G1xw1g= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15/go.mod h1:ZVJ7ejRl4+tkWMuCwjXoy0jd8fF5u3RCyWjSVjUIvQE= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.22 h1:ggHTCgbIivTM85PFjv/rkJbchrmLSNL+Vcj5hg54TyM= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.22/go.mod h1:zT2j7Ndi+FcBX+zfYLDppqODSgSdKlquB3LPLPVDAts= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.21 h1:7jUFr+7F4MzIjCZzy7ygRtXFQcQ0kAbT0gUvtUeAdyU= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.21/go.mod h1:q8nYq51W3gpZempYsAD83fPRlrOTMCwN+Ahg4BKFTXQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3 h1:UTTPNP3/WzZa7hoHP3Szb/Yl0bM3NoBrf5ABy1OArUM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3/go.mod h1:+IF75RMJh0+zqTGXGshyEGRsU2ImqWv6UuHGkHl6kEo= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.17 h1:LVM2jzEQ8mhb2dhrFl4PJ3sa5+KcKT01dsMk2Ma9/FU= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.17/go.mod h1:bQujK1n0V1D1Gz5uII1jaB1WDvhj4/T3tElsJnVXCR0= +github.com/aws/smithy-go v1.13.2 h1:TBLKyeJfXTrTXRHmsv4qWt9IQGYyWThLYaJWSahTOGE= +github.com/aws/smithy-go v1.13.2/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/bmatcuk/doublestar/v4 v4.2.0 h1:Qu+u9wR3Vd89LnlLMHvnZ5coJMWKQamqdz9/p5GNthA= @@ -352,8 +352,8 @@ github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= -github.com/microcosm-cc/bluemonday v1.0.19 h1:OI7hoF5FY4pFz2VA//RN8TfM0YJ2dJcl4P4APrCWy6c= -github.com/microcosm-cc/bluemonday v1.0.19/go.mod h1:QNzV2UbLK2/53oIIwTOyLUSABMkjZ4tqiyC1g/DyqxE= +github.com/microcosm-cc/bluemonday v1.0.20 h1:flpzsq4KU3QIYAYGV/szUat7H+GPOXR0B2JU5A1Wp8Y= +github.com/microcosm-cc/bluemonday v1.0.20/go.mod h1:yfBmMi8mxvaZut3Yytv+jTXRY8mxyjJ0/kQBTElld50= 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= @@ -398,8 +398,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCb github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.3.4 h1:3Z3Eu6FGHZWSfNKJTOUiPatWwfc7DzJRU04jFUqJODw= -github.com/rivo/uniseg v0.3.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= +github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 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= @@ -431,8 +431,8 @@ 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.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= @@ -475,8 +475,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= -github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.4.14 h1:jwww1XQfhJN7Zm+/a1ZA/3WUiEBEroYFNTiV3dKwM8U= +github.com/yuin/goldmark v1.4.14/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= @@ -527,8 +527,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 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-20220827204233-334a2380cb91 h1:tnebWN09GYg9OLPss1KXj8txwZc6X6uMr6VFdcGNbHw= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E= +golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= 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= @@ -590,8 +590,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= 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= @@ -601,8 +601,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ 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-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= 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= @@ -613,8 +613,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ 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-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= -golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= +golang.org/x/sync v0.0.0-20220907140024-f12130a52804/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -671,8 +671,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 h1:wM1k/lXfpc5HdkJJyW9GELpd8ERGdnh8sMGL6Gzq3Ho= +golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/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-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
chore
Update dependencies
d4559cf7d0758bdf0639926e984f8e45f369a261
2021-12-02 10:49:25
dependabot[bot]
chore(deps): bump assets/chezmoi.io/themes/book
false
diff --git a/assets/chezmoi.io/themes/book b/assets/chezmoi.io/themes/book index 8bb6d7ebec0..2e693816ae3 160000 --- a/assets/chezmoi.io/themes/book +++ b/assets/chezmoi.io/themes/book @@ -1 +1 @@ -Subproject commit 8bb6d7ebec03e232bf3544b25de8408b1a03b6fb +Subproject commit 2e693816ae3e4976a6bb15e5b23f3422b936f000
chore
bump assets/chezmoi.io/themes/book
e413bacec34e27e5daf5296b290c8f5a0fb53735
2021-09-25 01:52:35
Tom Payne
chore: Minor doc fixes
false
diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index 435656dc34a..e85ab8b42bd 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -8,7 +8,6 @@ Manage your dotfiles across multiple machines, securely. * [`--color` *value*](#--color-value) * [`-c`, `--config` *filename*](#-c---config-filename) * [`--config-format` `json`|`toml`|`yaml`](#--config-format-jsontomlyaml) - * [`--debug`](#--debug) * [`-D`, `--destination` *directory*](#-d---destination-directory) * [`-n`, `--dry-run`](#-n---dry-run) * [`--force`](#--force) @@ -30,6 +29,7 @@ Manage your dotfiles across multiple machines, securely. * [`-x`, `--exclude` *types*](#-x---exclude-types) * [Developer command line flags](#developer-command-line-flags) * [`--cpu-profile` *filename*](#--cpu-profile-filename) + * [`--debug`](#--debug) * [`--gops`](#--gops) * [Configuration file](#configuration-file) * [Variables](#variables) @@ -173,10 +173,6 @@ Read the configuration from *filename*. Assume the configuration file is in the given format. This is only needed if the config filename does not have an extension, for example when it is `/dev/stdin`. -### `--debug` - -Log information helpful for debugging. - ### `-D`, `--destination` *directory* Use *directory* as the destination directory. @@ -285,6 +281,10 @@ The following flags are global but only relevant for developers and debugging. Write a [Go CPU profile](https://blog.golang.org/pprof) to *filename*. +### `--debug` + +Log information helpful for debugging. + ### `--gops` Enable the [gops](https://github.com/google/gops) agent. @@ -325,6 +325,7 @@ The following configuration variables are available: | | `sourceDir` | string | `~/.local/share/chezmoi` | Source directory | | | `pager` | string | `$PAGER` | Default pager | | | `umask` | int | *from system* | Umask | +| | `useBuiltinAge` | string | `auto` | Use builtin git if `age` command is not found in $PATH | | | `useBuiltinGit` | string | `auto` | Use builtin git if `git` command is not found in $PATH | | `add` | `templateSymlinks` | bool | `false` | Template symlinks to source and home dirs | | `age` | `args` | []string | *none* | Extra args to age CLI command |
chore
Minor doc fixes
68bcd9562a01a69e92f4c034840cb5012dad3a23
2024-09-09 16:28:28
Tom Payne
chore: Skip test requiring network if DNS lookup fails
false
diff --git a/internal/cmd/applycmd_test.go b/internal/cmd/applycmd_test.go index 41d43273abf..83a3dd90d86 100644 --- a/internal/cmd/applycmd_test.go +++ b/internal/cmd/applycmd_test.go @@ -2,6 +2,7 @@ package cmd import ( "io/fs" + "net" "net/http" "net/http/httptest" "path/filepath" @@ -261,6 +262,10 @@ func TestIssue2132(t *testing.T) { } func TestIssue2597(t *testing.T) { + _, err := net.LookupIP("github.com") + if err != nil { + t.Skip("github.com not found") + } chezmoitest.WithTestFS(t, map[string]any{ "/home/user": map[string]any{ ".local/share/chezmoi": map[string]any{
chore
Skip test requiring network if DNS lookup fails
87802f28d9b654ff836425ba019c457a1544d0f9
2023-12-09 05:14:08
Tom Payne
chore: Tidy up error checks
false
diff --git a/internal/chezmoi/externaldiffsystem.go b/internal/chezmoi/externaldiffsystem.go index 6b63a4e5d4c..8882ab5f001 100644 --- a/internal/chezmoi/externaldiffsystem.go +++ b/internal/chezmoi/externaldiffsystem.go @@ -338,8 +338,8 @@ func (s *ExternalDiffSystem) runDiffCommand(destAbsPath, targetAbsPath AbsPath) // Swallow exit status 1 errors if the files differ as diff commands // traditionally exit with code 1 in this case. - var exitError *exec.ExitError - if errors.As(err, &exitError) && exitError.ProcessState.ExitCode() == 1 { + if exitError := (&exec.ExitError{}); errors.As(err, &exitError) && + exitError.ProcessState.ExitCode() == 1 { destData, err2 := s.ReadFile(destAbsPath) switch { case errors.Is(err2, fs.ErrNotExist): diff --git a/internal/chezmoilog/chezmoilog.go b/internal/chezmoilog/chezmoilog.go index c78eae9cb02..b8459ce55e8 100644 --- a/internal/chezmoilog/chezmoilog.go +++ b/internal/chezmoilog/chezmoilog.go @@ -60,13 +60,12 @@ func (err OSExecExitErrorLogObject) MarshalZerologObject(event *zerolog.Event) { if err.Err == nil { return } - var osExecExitError *exec.ExitError - if !errors.As(err.Err, &osExecExitError) { - return - } - event.EmbedObject(OSProcessStateLogObject{osExecExitError.ProcessState}) - if osExecExitError.Stderr != nil { - event.Bytes("stderr", osExecExitError.Stderr) + if osExecExitError := (&exec.ExitError{}); errors.As(err.Err, &osExecExitError) { + event.EmbedObject(OSProcessStateLogObject{osExecExitError.ProcessState}) + if osExecExitError.Stderr != nil { + event.Bytes("stderr", osExecExitError.Stderr) + return + } } } diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 5de88202cf7..5d1ef615d4f 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -120,8 +120,7 @@ func Main(versionInfo VersionInfo, args []string) int { } } if err != nil { - var errExitCode chezmoi.ExitCodeError - if errors.As(err, &errExitCode) { + if errExitCode := chezmoi.ExitCodeError(0); errors.As(err, &errExitCode) { return int(errExitCode) } fmt.Fprintf(os.Stderr, "chezmoi: %s\n", deDuplicateError(err)) diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 9d0447d4a02..fc546c9aaf1 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -2523,8 +2523,7 @@ func (c *Config) sourceAbsPaths( func (c *Config) targetRelPath(absPath chezmoi.AbsPath) (chezmoi.RelPath, error) { relPath, err := absPath.TrimDirPrefix(c.DestDirAbsPath) - var notInAbsDirError *chezmoi.NotInAbsDirError - if errors.As(err, &notInAbsDirError) { + if notInAbsDirError := (&chezmoi.NotInAbsDirError{}); errors.As(err, &notInAbsDirError) { return chezmoi.EmptyRelPath, fmt.Errorf( "%s: not in destination directory (%s)", absPath,
chore
Tidy up error checks
6e8afbd4d915d65a43a0860fbed1479fce80c984
2022-10-12 16:25:06
Tom Payne
chore: Fail if multiple config file templates are found
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 1428c5ad62f..65d98a414b4 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -452,7 +452,7 @@ func (c *Config) applyArgs( } var currentConfigTemplateContentsSHA256 []byte - configTemplate, err := c.findFirstConfigTemplate() + configTemplate, err := c.findConfigTemplate() if err != nil { return err } @@ -607,7 +607,7 @@ func (c *Config) colorAutoFunc() bool { // template and reloads it. func (c *Config) createAndReloadConfigFile() error { // Find config template, execute it, and create config file. - configTemplate, err := c.findFirstConfigTemplate() + configTemplate, err := c.findConfigTemplate() if err != nil { return err } @@ -1213,9 +1213,10 @@ type configTemplate struct { contents []byte } -// findFirstConfigTemplate searches for a config template, returning the path, -// format, and contents of the first one that it finds. -func (c *Config) findFirstConfigTemplate() (*configTemplate, error) { +// findConfigTemplate searches for a config template, returning the path, +// format, and contents. It returns an error if multiple config file templates +// are found. +func (c *Config) findConfigTemplate() (*configTemplate, error) { sourceDirAbsPath, err := c.getSourceDirAbsPath() if err != nil { return nil, err @@ -1234,6 +1235,7 @@ func (c *Config) findFirstConfigTemplate() (*configTemplate, error) { dirEntryNames[chezmoi.NewRelPath(dirEntry.Name())] = struct{}{} } + var configTemplates []*configTemplate //nolint:prealloc for _, extension := range chezmoi.FormatExtensions { relPath := chezmoi.NewRelPath(chezmoi.Prefix + "." + extension + chezmoi.TemplateSuffix) if _, ok := dirEntryNames[relPath]; !ok { @@ -1244,14 +1246,28 @@ func (c *Config) findFirstConfigTemplate() (*configTemplate, error) { if err != nil { return nil, err } - return &configTemplate{ + configTemplate := &configTemplate{ targetRelPath: chezmoi.NewRelPath("chezmoi." + extension), format: chezmoi.FormatsByExtension[extension], sourceAbsPath: absPath, contents: contents, - }, nil + } + configTemplates = append(configTemplates, configTemplate) + } + + switch len(configTemplates) { + case 0: + return nil, nil + case 1: + return configTemplates[0], nil + default: + sourceAbsPathStrs := make([]string, 0, len(configTemplates)) + for _, configTemplate := range configTemplates { + sourceAbsPathStr := configTemplate.sourceAbsPath.String() + sourceAbsPathStrs = append(sourceAbsPathStrs, sourceAbsPathStr) + } + return nil, fmt.Errorf("multiple config file templates: %s ", englishList(sourceAbsPathStrs)) } - return nil, nil } func (c *Config) getHTTPClient() (*http.Client, error) { diff --git a/pkg/cmd/testdata/scripts/errors.txtar b/pkg/cmd/testdata/scripts/errors.txtar index 0c12a134cc4..bfd8cccdb56 100644 --- a/pkg/cmd/testdata/scripts/errors.txtar +++ b/pkg/cmd/testdata/scripts/errors.txtar @@ -34,6 +34,12 @@ chhome home6/user ! exec chezmoi verify stderr 'inconsistent state' +chhome home7/user + +# test that chezmoi init returns an error if there are multiple config file templates +! exec chezmoi init +stderr 'multiple config file templates' + # FIXME add more tests -- home2/user/.config/chezmoi/chezmoi.json -- @@ -50,3 +56,5 @@ home # contents of install_packages -- home6/user/.local/share/chezmoi/run_once_install_packages -- # contents of install_packages +-- home7/user/.local/share/chezmoi/.chezmoi.json.tmpl -- +-- home7/user/.local/share/chezmoi/.chezmoi.toml.tmpl --
chore
Fail if multiple config file templates are found
6ed080bba2bd3f439832c2bd4b14ed2812c8ee9b
2022-01-23 23:42:56
Tom Payne
chore: Make htmltest ignore more URLs
false
diff --git a/assets/chezmoi.io/htmltest.yml b/assets/chezmoi.io/htmltest.yml index 7c70362796c..8cf5e3639cd 100644 --- a/assets/chezmoi.io/htmltest.yml +++ b/assets/chezmoi.io/htmltest.yml @@ -4,12 +4,15 @@ IgnoreDirs: IgnoreInternalEmptyHash: true IgnoreURLs: - http://127\.0\.0\.1:8000/ +- http://blog\.emilieschario\.com/ - https://blog\.lazkani\.io/ - https://computingforgeeks\.com/ +- https://docs\.github\.com/ - https://fonts\.gstatic\.com - https://github\.com/twpayne/chezmoi/ - https://johnmathews\.eu/ - https://johnmathews\.is/ +- https://jonathanbartlett\.co\.uk/ - https://lastpass\.com/ - https://www\.jx0\.uk/ - https://www\.vaultproject\.io/
chore
Make htmltest ignore more URLs
c0b7e9249ba604226cd1d5f136d120ecc3d2bc91
2024-02-19 13:46:11
Tom Payne
fix: Don't attempt to add entries in external_ directories
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index e31ff6d7491..e96a7d9304f 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -393,8 +393,28 @@ DEST_ABS_PATH: parentSourceRelPath = SourceRelPath{} } else if parentEntry, ok := newSourceStateEntriesByTargetRelPath[targetParentRelPath]; ok { parentSourceRelPath = parentEntry.SourceRelPath() - } else if parentEntry := s.root.Get(targetParentRelPath); parentEntry != nil { - parentSourceRelPath = parentEntry.SourceRelPath() + } else if nodes := s.root.GetNodes(targetParentRelPath); nodes != nil { + for i, node := range nodes { + if i == 0 { + // nodes[0].sourceStateEntry should always be nil because it + // refers to the destination directory, which is not manged. + // chezmoi manages the destination directory's contents, not + // the destination directory itself. For example, chezmoi + // does not set the name or permissions of the user's home + // directory. + if node.sourceStateEntry != nil { + panic(fmt.Errorf("nodes[0]: expected nil, got %+v", node.sourceStateEntry)) + } + continue + } + switch sourceStateDir, ok := node.sourceStateEntry.(*SourceStateDir); { + case i != len(nodes)-1 && !ok: + panic(fmt.Errorf("nodes[%d]: unexpected non-terminal source state entry, got %T", i, node.sourceStateEntry)) + case sourceStateDir.Attr.External: + return fmt.Errorf("%s: cannot add entry in external_ directory", destAbsPath) + } + } + parentSourceRelPath = nodes[len(nodes)-1].sourceStateEntry.SourceRelPath() } else { return fmt.Errorf("%s: parent directory not in source state", destAbsPath) } diff --git a/internal/chezmoi/sourcestatetreenode.go b/internal/chezmoi/sourcestatetreenode.go index c4589f65aa7..fd6ae8d3616 100644 --- a/internal/chezmoi/sourcestatetreenode.go +++ b/internal/chezmoi/sourcestatetreenode.go @@ -22,28 +22,30 @@ func newSourceStateTreeNode() *sourceStateEntryTreeNode { // Get returns the SourceStateEntry at relPath. func (n *sourceStateEntryTreeNode) Get(relPath RelPath) SourceStateEntry { - node := n.GetNode(relPath) - if node == nil { + nodes := n.GetNodes(relPath) + if nodes == nil { return nil } - return node.sourceStateEntry + return nodes[len(nodes)-1].sourceStateEntry } -// GetNode returns the SourceStateTreeNode at relPath. -func (n *sourceStateEntryTreeNode) GetNode(targetRelPath RelPath) *sourceStateEntryTreeNode { +// GetNodes returns the sourceStateEntryTreeNodes to reach targetRelPath. +func (n *sourceStateEntryTreeNode) GetNodes(targetRelPath RelPath) []*sourceStateEntryTreeNode { if targetRelPath.Empty() { - return n + return []*sourceStateEntryTreeNode{n} } - node := n - for _, childRelPath := range targetRelPath.SplitAll() { - if childNode, ok := node.children[childRelPath]; ok { - node = childNode + targetRelPathComponents := targetRelPath.SplitAll() + nodes := make([]*sourceStateEntryTreeNode, 0, len(targetRelPathComponents)) + nodes = append(nodes, n) + for _, childRelPath := range targetRelPathComponents { + if childNode, ok := nodes[len(nodes)-1].children[childRelPath]; ok { + nodes = append(nodes, childNode) } else { return nil } } - return node + return nodes } // ForEach calls f for each SourceStateEntry in the tree. diff --git a/internal/chezmoi/sourcestatetreenode_test.go b/internal/chezmoi/sourcestatetreenode_test.go index d8526335f62..d944a187050 100644 --- a/internal/chezmoi/sourcestatetreenode_test.go +++ b/internal/chezmoi/sourcestatetreenode_test.go @@ -10,7 +10,7 @@ import ( func TestSourceStateEntryTreeNodeEmpty(t *testing.T) { n := newSourceStateTreeNode() assert.Equal(t, nil, n.Get(EmptyRelPath)) - assert.Equal(t, n, n.GetNode(EmptyRelPath)) + assert.Equal(t, []*sourceStateEntryTreeNode{n}, n.GetNodes(EmptyRelPath)) assert.NoError(t, n.ForEach(EmptyRelPath, func(RelPath, SourceStateEntry) error { return errors.New("should not be called") })) diff --git a/internal/cmd/testdata/scripts/issue3525.txtar b/internal/cmd/testdata/scripts/issue3525.txtar new file mode 100644 index 00000000000..631b8033f38 --- /dev/null +++ b/internal/cmd/testdata/scripts/issue3525.txtar @@ -0,0 +1,13 @@ +# test that chezmoi add does not add files in external_ directories +! exec chezmoi add $HOME${/}.external/file +stderr 'cannot add entry in external_ directory' + +# test that chezmoi add does not add files in subdirectories of external_ directories +! exec chezmoi add $HOME${/}.external/dir/file +stderr 'cannot add entry in external_ directory' + +-- home/user/.external/dir/file -- +# contents of .external/dir/file +-- home/user/.external/file -- +# contents of .external/file +-- home/user/.local/share/chezmoi/external_dot_external/.keep --
fix
Don't attempt to add entries in external_ directories
34e04754af3aab62e634043e701b307076c44b13
2023-12-17 04:38:59
Tom Payne
chore: Update GitHub Actions
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 952fd660afe..d73ec51deba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: reviewdog/action-misspell@cc799b020b057600b66eedf2b6e97ca26137de21 + - uses: reviewdog/action-misspell@4348e72b9038b006ffc37b6b0dd4421a2e9a68ef with: locale: US test-alpine: @@ -175,31 +175,31 @@ jobs: args: release --skip=sign --snapshot --timeout=1h - name: upload-artifact-chezmoi-darwin-amd64 if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 with: name: chezmoi-darwin-amd64 path: dist/chezmoi-nocgo_darwin_amd64_v1/chezmoi - name: upload-artifact-chezmoi-darwin-arm64 if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 with: name: chezmoi-darwin-arm64 path: dist/chezmoi-nocgo_darwin_arm64/chezmoi - name: upload-artifact-chezmoi-linux-amd64 if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 with: name: chezmoi-linux-amd64 path: dist/chezmoi-cgo-glibc_linux_amd64_v1/chezmoi - name: upload-artifact-chezmoi-linux-musl-amd64 if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 with: name: chezmoi-linux-amd64-musl path: dist/chezmoi-cgo-musl_linux_amd64_v1/chezmoi - name: upload-artifact-chezmoi-windows-amd64.exe if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 with: name: chezmoi-windows-amd64 path: dist/chezmoi-nocgo_windows_amd64_v1/chezmoi.exe @@ -388,7 +388,7 @@ jobs: - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} - - uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 + - uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 - name: create-syso run: | make create-syso
chore
Update GitHub Actions
785bd8464fc6fc6503ada0581f03053f3fbdf8b0
2021-11-02 04:24:47
Tom Payne
chore: Don't assume sudo for MacPorts install
false
diff --git a/docs/INSTALL.md b/docs/INSTALL.md index b3b50153aff..5193220c86f 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -63,7 +63,7 @@ Install chezmoi with a single command. | NixOS Linux | nix-env | `nix-env -i chezmoi` | | Void Linux | xbps | `xbps-install -S chezmoi` | | macOS | Homebrew | `brew install chezmoi` | -| macOS | MacPorts | `sudo port install chezmoi` | +| macOS | MacPorts | `port install chezmoi` | | Windows | Scoop | `scoop bucket add twpayne https://github.com/twpayne/scoop-bucket && scoop install chezmoi` | | Windows | Chocolatey | `choco install chezmoi` | | FreeBSD | pkg | `pkg install chezmoi` |
chore
Don't assume sudo for MacPorts install
04906cbc4a9f041e9c4d8bff4457603894100f5e
2022-01-04 19:05:44
Tom Payne
chore: Tidy up debian11-i386 Vagrant test
false
diff --git a/assets/vagrant/debian11-i386.Vagrantfile b/assets/vagrant/debian11-i386.Vagrantfile index 45fdf3c0c8b..d6389161e78 100644 --- a/assets/vagrant/debian11-i386.Vagrantfile +++ b/assets/vagrant/debian11-i386.Vagrantfile @@ -4,6 +4,7 @@ Vagrant.configure("2") do |config| 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 zip SHELL config.vm.provision "file", source: "assets/vagrant/debian11-i386.test-chezmoi.sh", destination: "test-chezmoi.sh" diff --git a/assets/vagrant/debian11-i386.test-chezmoi.sh b/assets/vagrant/debian11-i386.test-chezmoi.sh index 533c72f4a86..fcebe9e175c 100755 --- a/assets/vagrant/debian11-i386.test-chezmoi.sh +++ b/assets/vagrant/debian11-i386.test-chezmoi.sh @@ -2,7 +2,7 @@ set -eufo pipefail -GO_VERSION=$(grep GO_VERSION: /chezmoi/.github/workflows/main.yml | awk '{ print $2 }' ) +GO_VERSION=$(awk '/GO_VERSION:/ { print $2 }' /chezmoi/.github/workflows/main.yml) go get "golang.org/dl/go${GO_VERSION}" "${HOME}/go/bin/go${GO_VERSION}" download
chore
Tidy up debian11-i386 Vagrant test
b9995091373a9dbec57bda99522008732853d835
2022-03-24 19:53:57
Tom Payne
fix: Prefer id over label for onepasswordDetailsFields template function
false
diff --git a/assets/chezmoi.io/docs/reference/templates/functions/onepasswordDetailsFields.md b/assets/chezmoi.io/docs/reference/templates/functions/onepasswordDetailsFields.md index 88b71b986f9..5103c684e7c 100644 --- a/assets/chezmoi.io/docs/reference/templates/functions/onepasswordDetailsFields.md +++ b/assets/chezmoi.io/docs/reference/templates/functions/onepasswordDetailsFields.md @@ -2,11 +2,16 @@ `onepasswordDetailsFields` returns structured data from [1Password](https://1password.com/) using the [1Password -CLI](https://support.1password.com/command-line-getting-started/) (`op`). *uuid* -is passed to `op get item $UUID`, the output from `op` is parsed as JSON, and -elements of `details.fields` are returned as a map indexed by each field's -`designation`. If there is no valid session in the environment, by default you -will be interactively prompted to sign in. +CLI](https://support.1password.com/command-line-getting-started/) (`op`). +*uuid* is passed to `op get item $UUID`, the output from `op` is parsed as +JSON, and elements of `details.fields` are returned as a map indexed by each +field's `id` (if set) or `label` (if set and `id` is not present). If there is +no valid session in the environment, by default you will be interactively +prompted to sign in. + +!!! info + + For 1Password CLI 1.x, the map is indexed by each field's `designation`. The output from `op` is cached so calling `onepasswordDetailsFields` multiple times with the same *uuid* will only invoke `op` once. If the optional diff --git a/pkg/cmd/onepasswordtemplatefuncs.go b/pkg/cmd/onepasswordtemplatefuncs.go index 2749609d3a7..7342a6b9b59 100644 --- a/pkg/cmd/onepasswordtemplatefuncs.go +++ b/pkg/cmd/onepasswordtemplatefuncs.go @@ -120,8 +120,13 @@ func (c *Config) onepasswordDetailsFieldsTemplateFunc(userArgs ...string) map[st if _, ok := field["section"]; ok { continue } - if label, ok := field["label"].(string); ok { + if id, ok := field["id"].(string); ok && id != "" { + result[id] = field + continue + } + if label, ok := field["label"].(string); ok && label != "" { result[label] = field + continue } } return result
fix
Prefer id over label for onepasswordDetailsFields template function
8e1d6478d2c7f076dcd72bca1fb90b0acccf0516
2021-11-20 06:08:53
MuXiu1997
feat: Add gitHubLatestRelease template function
false
diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index 10bc62caebc..d1793e2a986 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -106,6 +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) * [`gopass` *gopass-name*](#gopass-gopass-name) * [`gopassRaw` *gopass-name*](#gopassraw-gopass-name) * [`include` *filename*](#include-filename) @@ -2044,7 +2045,7 @@ environment variables `$CHEZMOI_GITHUB_ACCESS_TOKEN`, `$GITHUB_ACCESS_TOKEN`, or the GitHub API request, with a higher rate limit (currently 5,000 requests per hour per user). -In practice, GitHub API rate limits are high enough that you should never need +In practice, GitHub API rate limits are high enough that you should rarely need to set a token, unless you are sharing a source IP address with many other GitHub users. If needed, the GitHub documentation describes how to [create a personal access @@ -2060,6 +2061,26 @@ token](https://docs.github.com/en/github/authenticating-to-github/creating-a-per --- +### `gitHubLatestRelease` *user-repo* + +`gitHubLatestRelease` calls the GitHub API to retrieve the latest release about the given +*user-repo*, returning structured data as defined by the [GitHub Go API +bindings](https://pkg.go.dev/github.com/google/go-github/v40/github#RepositoryRelease). + +Calls to `gitHubLatestRelease` are cached so calling `gitHubLatestRelease` with the same +*user-repo* will only result in one call to the GitHub API. + + +`gitHubLatestRelease` uses the same API request mechanism as `gitHubKeys`. + +#### `gitHubLatestRelease` examples + +``` +{{ (gitHubLatestRelease "docker/compose").TagName }} +``` + +--- + ### `gopass` *gopass-name* `gopass` returns passwords stored in [gopass](https://www.gopass.pw/) using the diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 51ba2bc2acf..efecb84ff17 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -404,6 +404,7 @@ func newConfig(options ...configOption) (*Config, error) { "decrypt": c.decryptTemplateFunc, "encrypt": c.encryptTemplateFunc, "gitHubKeys": c.gitHubKeysTemplateFunc, + "gitHubLatestRelease": c.gitHubLatestReleaseTemplateFunc, "gopass": c.gopassTemplateFunc, "gopassRaw": c.gopassRawTemplateFunc, "include": c.includeTemplateFunc, diff --git a/internal/cmd/githubtemplatefuncs.go b/internal/cmd/githubtemplatefuncs.go index da35518c42e..a35bc7c7b3d 100644 --- a/internal/cmd/githubtemplatefuncs.go +++ b/internal/cmd/githubtemplatefuncs.go @@ -2,12 +2,15 @@ package cmd import ( "context" + "fmt" + "strings" "github.com/google/go-github/v40/github" ) type gitHubData struct { - keysCache map[string][]*github.Key + keysCache map[string][]*github.Key + latestReleaseCache map[string]map[string]*github.RepositoryRelease } func (c *Config) gitHubKeysTemplateFunc(user string) []*github.Key { @@ -43,3 +46,42 @@ func (c *Config) gitHubKeysTemplateFunc(user string) []*github.Key { c.gitHub.keysCache[user] = allKeys return allKeys } + +func (c *Config) gitHubLatestReleaseTemplateFunc(userRepo string) *github.RepositoryRelease { + user, repo := parseGitHubUserRepo(userRepo) + + if release := c.gitHub.latestReleaseCache[user][repo]; release != nil { + return release + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + gitHubClient := newGitHubClient(ctx) + + release, _, err := gitHubClient.Repositories.GetLatestRelease(ctx, user, repo) + if err != nil { + returnTemplateError(err) + return nil + } + + if c.gitHub.latestReleaseCache == nil { + c.gitHub.latestReleaseCache = make(map[string]map[string]*github.RepositoryRelease) + } + if c.gitHub.latestReleaseCache[user] == nil { + c.gitHub.latestReleaseCache[user] = make(map[string]*github.RepositoryRelease) + } + c.gitHub.latestReleaseCache[user][repo] = release + + return release +} + +func parseGitHubUserRepo(userRepo string) (string, string) { + fields := strings.SplitN(userRepo, "/", 2) + if len(fields) != 2 || fields[0] == "" || fields[1] == "" { + returnTemplateError(fmt.Errorf("%s: not a user/repo", userRepo)) + return "", "" + } + user, repo := fields[0], fields[1] + return user, repo +}
feat
Add gitHubLatestRelease template function
41f38ac671a42be9edb7c1a2ccd6ffd40b29e768
2023-05-22 13:54:54
Tom Payne
docs: Add link to podcast
false
diff --git a/assets/chezmoi.io/docs/links/links.yaml b/assets/chezmoi.io/docs/links/links.yaml index d0c3430f89b..223000394aa 100644 --- a/assets/chezmoi.io/docs/links/links.yaml +++ b/assets/chezmoi.io/docs/links/links.yaml @@ -436,3 +436,11 @@ articles: title: 'chezmoi' lang: JP url: 'https://www.ebiyuu.com/dotfiles/chezmoi/' +- date: '2023-05-22' + version: 2.33.6 + formats: + - audio + - text + title: '491 - Tres herramientas que han revolucionado mi terminal Linux' + lang: ES + url: https://atareao.es/podcast/tres-herramientas-que-han-revolucionado-mi-terminal-linux/
docs
Add link to podcast
d16ce211bcd2c55cc1c9ad8df13f3222944caf5f
2023-02-06 13:44:47
Tom Payne
docs: Add link to podcast
false
diff --git a/assets/chezmoi.io/docs/links/links.yaml b/assets/chezmoi.io/docs/links/links.yaml index b74c603f47d..72e91e55650 100644 --- a/assets/chezmoi.io/docs/links/links.yaml +++ b/assets/chezmoi.io/docs/links/links.yaml @@ -379,3 +379,10 @@ articles: title: dotfile manager の chezmoi に移行してみる lang: JP url: https://blog.yamano.dev/posts/2023/01/chezmoi-setup/ +- date: '2023-01-30' + version: 2.29.3 + formats: + - audio + title: '459 - Soy un zoquete, otra vez hice un rm -rf' + lang: ES + url: https://atareao.es/podcast/soy-un-zoquete-otra-vez-hice-un-rm-rf/
docs
Add link to podcast
f1deb0b655d7ba229c50c2b3beb6c3d255344928
2025-03-19 17:57:25
Tom Payne
chore: Fix broken link
false
diff --git a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md index a6a1a638e00..806b2f8af9a 100644 --- a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md +++ b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md @@ -68,8 +68,8 @@ If you really want to use symlinks, then chezmoi provides a [symlink mode][symlink] which uses symlinks where possible. This configures chezmoi to work like GNU Stow and have it create a set of symlinks back to a central directory, but this currently requires a bit of manual work (as described in -[issue #167][#167]). chezmoi might get some automation to help (see [issue -#886][#886] for example) but it does need some convincing use cases that +[issue #167][#167]). chezmoi might get some automation to help (see +[issue #886][#886] for example) but it does need some convincing use cases that demonstrate that a symlink from a dotfile's location to its contents in a central directory is better than just having the correct dotfile contents.
chore
Fix broken link
98cd08e84b0b6cfd7e437d026eb3fe4c541094b3
2024-10-22 05:36:08
Tom Payne
chore: Add link to podcast
false
diff --git a/assets/chezmoi.io/docs/links/podcasts.md.yaml b/assets/chezmoi.io/docs/links/podcasts.md.yaml index 2334ad8a31b..c7d17c1303c 100644 --- a/assets/chezmoi.io/docs/links/podcasts.md.yaml +++ b/assets/chezmoi.io/docs/links/podcasts.md.yaml @@ -41,3 +41,7 @@ podcasts: lang: ES title: 491 - Tres herramientas que han revolucionado mi terminal Linux url: https://atareao.es/podcast/tres-herramientas-que-han-revolucionado-mi-terminal-linux/ +- date: '2024-10-17' + version: 2.52.4 + title: Releasing more BSDs + url: https://www.bsdnow.tv/581?t=2064
chore
Add link to podcast
597a2d948832bb5e08e48e6450e20dd6788bcb03
2021-12-23 22:50:07
Tom Payne
chore: Strengthen password manager tests
false
diff --git a/internal/cmd/testdata/scripts/bitwarden.txt b/internal/cmd/testdata/scripts/bitwarden.txt index f37759a5e0b..8f79a0910fa 100644 --- a/internal/cmd/testdata/scripts/bitwarden.txt +++ b/internal/cmd/testdata/scripts/bitwarden.txt @@ -1,17 +1,18 @@ [!windows] chmod 755 bin/bw [windows] unix2dos bin/bw.cmd +[windows] unix2dos golden/bitwarden-attachment # test bitwarden template function chezmoi execute-template '{{ (bitwarden "item" "example.com").login.password }}' -stdout password-value +stdout ^password-value$ # test bitwardenFields template function chezmoi execute-template '{{ (bitwardenFields "item" "example.com").Hidden.value }}' -stdout hidden-value +stdout ^hidden-value$ # test bitwardenAttachment template function chezmoi execute-template '{{ (bitwardenAttachment "filename" "item-id") }}' -stdout hidden-file-value +cmp stdout golden/bitwarden-attachment -- bin/bw -- #!/bin/sh @@ -95,9 +96,11 @@ IF "%*" == "get item example.com" ( echo. "revisionDate": "2020-10-28T00:21:02.690Z" echo.} ) ELSE IF "%*" == "get attachment filename --itemid item-id --raw" ( - echo. hidden-file-value + echo.hidden-file-value ) ELSE ( echo Invalid command: $* echo "See --help for a list of available commands." exit /b 1 ) +-- golden/bitwarden-attachment -- +hidden-file-value diff --git a/internal/cmd/testdata/scripts/gopass.txt b/internal/cmd/testdata/scripts/gopass.txt index 75432da601f..bc532d0c4ca 100644 --- a/internal/cmd/testdata/scripts/gopass.txt +++ b/internal/cmd/testdata/scripts/gopass.txt @@ -1,13 +1,14 @@ [!windows] chmod 755 bin/gopass [windows] unix2dos bin/gopass.cmd +[windows] unix2dos golden/gopass-raw # test gopass template function chezmoi execute-template '{{ gopass "misc/example.com" }}' -stdout examplepassword +stdout ^examplepassword$ # test gopass template function chezmoi execute-template '{{ gopassRaw "misc/example.com" }}' -stdout 'Secret: misc/example\.com' +cmp stdout golden/gopass-raw -- bin/gopass -- #!/bin/sh @@ -34,10 +35,10 @@ esac IF "%*" == "--version" ( echo "gopass 1.10.1 go1.15 windows amd64" ) ELSE IF "%*" == "show --noparsing misc/example.com" ( - echo "Secret: misc/example.com" - echo - echo "examplepassword" - echo "key: value" + echo.Secret: misc/example.com + echo. + echo.examplepassword + echo.key: value ) ELSE IF "%*" == "show --password misc/example.com" ( echo | set /p=examplepassword exit /b 0 @@ -45,3 +46,8 @@ IF "%*" == "--version" ( echo gopass: invalid command: %* exit /b 1 ) +-- golden/gopass-raw -- +Secret: misc/example.com + +examplepassword +key: value diff --git a/internal/cmd/testdata/scripts/keepassxc.txt b/internal/cmd/testdata/scripts/keepassxc.txt index a3b0eda5020..291f7f6e978 100644 --- a/internal/cmd/testdata/scripts/keepassxc.txt +++ b/internal/cmd/testdata/scripts/keepassxc.txt @@ -4,12 +4,12 @@ # test keepassxcAttribute template function stdin $HOME/input chezmoi execute-template --no-tty '{{ keepassxcAttribute "example.com" "host-name" }}' -stdout example.com +stdout example\.com$ # test keepassxc template function and that password is only requested once stdin $HOME/input chezmoi execute-template --no-tty '{{ (keepassxc "example.com").UserName }}/{{ (keepassxc "example.com").Password }}' -stdout examplelogin/examplepassword +stdout examplelogin/examplepassword$ -- bin/keepass-test -- #!/bin/sh diff --git a/internal/cmd/testdata/scripts/lastpass.txt b/internal/cmd/testdata/scripts/lastpass.txt index 7956903116e..aaa92e6cf19 100644 --- a/internal/cmd/testdata/scripts/lastpass.txt +++ b/internal/cmd/testdata/scripts/lastpass.txt @@ -3,7 +3,7 @@ # test lastpass template function chezmoi execute-template '{{ (index (lastpass "example.com") 0).password }}' -stdout examplepassword +stdout ^examplepassword$ # test lastpass version check chmod 755 $WORK/bin2/lpass diff --git a/internal/cmd/testdata/scripts/secret.txt b/internal/cmd/testdata/scripts/secret.txt index 57dfd8e569a..3054467f688 100644 --- a/internal/cmd/testdata/scripts/secret.txt +++ b/internal/cmd/testdata/scripts/secret.txt @@ -3,11 +3,11 @@ # test secret template function chezmoi execute-template '{{ secret "password" }}' -stdout password +stdout ^password$ # test secretJSON template function chezmoi execute-template '{{ (secretJSON "{\"password\":\"secret\"}").password }}' -stdout secret +stdout ^secret$ -- bin/secret -- #!/bin/sh diff --git a/internal/cmd/testdata/scripts/vault.txt b/internal/cmd/testdata/scripts/vault.txt index 5650a6b9888..19676d6391f 100644 --- a/internal/cmd/testdata/scripts/vault.txt +++ b/internal/cmd/testdata/scripts/vault.txt @@ -3,7 +3,7 @@ # test vault template function chezmoi execute-template '{{ (vault "secret/examplesecret").data.data.password }}' -stdout examplepassword +stdout ^examplepassword$ -- bin/vault -- #!/bin/sh
chore
Strengthen password manager tests
8ce9ccf41f3853af23a136f8edb3bf3b818aa49c
2024-07-15 05:33:57
Tom Payne
chore: Build with goreleaser v2.1.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cd9bfabb1b..fd8afdcf96a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ env: GOFUMPT_VERSION: 0.6.0 # https://github.com/mvdan/gofumpt/releases GOLANGCI_LINT_VERSION: 1.59.1 # https://github.com/golangci/golangci-lint/releases GOLINES_VERSION: 0.12.2 # https://github.com/segmentio/golines/releases - GORELEASER_VERSION: 2.0.1 # https://github.com/goreleaser/goreleaser/releases + GORELEASER_VERSION: 2.1.0 # https://github.com/goreleaser/goreleaser/releases GOVERSIONINFO_VERSION: 1.4.0 # https://github.com/josephspurrier/goversioninfo/releases RAGE_VERSION: 0.10.0 # https://github.com/str4d/rage/releases jobs: @@ -186,10 +186,6 @@ jobs: run: | sudo apt-get --quiet update sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft - # https://github.com/goreleaser/goreleaser/issues/1715 - # https://bugs.launchpad.net/snapcraft/+bug/1889741 - mkdir -p "${HOME}/.cache/snapcraft/download" - mkdir -p "${HOME}/.cache/snapcraft/stage-packages" mkdir -p /opt/chocolatey wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" echo '#!/bin/bash' >> /usr/local/bin/choco @@ -411,10 +407,6 @@ jobs: run: | sudo apt-get --quiet update sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft - # https://github.com/goreleaser/goreleaser/issues/1715 - # https://bugs.launchpad.net/snapcraft/+bug/1889741 - mkdir -p "${HOME}/.cache/snapcraft/download" - mkdir -p "${HOME}/.cache/snapcraft/stage-packages" mkdir -p /opt/chocolatey wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" echo '#!/bin/bash' >> /usr/local/bin/choco
chore
Build with goreleaser v2.1.0
0185fb8da635c9f991bf69531ed6b7c4687a895c
2025-01-27 19:53:15
Tom Payne
docs: Add link to article
false
diff --git a/assets/chezmoi.io/docs/links/articles.md.yaml b/assets/chezmoi.io/docs/links/articles.md.yaml index 5f93c5e3e05..04a79a8abdf 100644 --- a/assets/chezmoi.io/docs/links/articles.md.yaml +++ b/assets/chezmoi.io/docs/links/articles.md.yaml @@ -493,3 +493,8 @@ articles: version: 2.58.0 title: Managing dotfiles with chezmoi url: https://natelandau.com/managing-dotfiles-with-chezmoi/ +- date: '2025-01-26' + version: 2.58.0 + lang: JP + title: 'chezmoi で macOS の user defaults も管理する' + url: https://pihero.hatenadiary.jp/entry/2025/01/26/130123
docs
Add link to article
21e99c7283fce8767508268eadf976a565dacd9a
2022-09-24 02:26:32
Tom Payne
feat: Add option to suppress warnings
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 a99aa43c241..66e596fe6f2 100644 --- a/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml +++ b/assets/chezmoi.io/docs/reference/configuration-file/variables.md.yaml @@ -267,3 +267,7 @@ sections: exclude: type: "[]string" description: "Entry types to exclude from verify" + warnings: + "": + type: "object" + description: "See section on \"Warnings\"" diff --git a/assets/chezmoi.io/docs/reference/configuration-file/warnings.md b/assets/chezmoi.io/docs/reference/configuration-file/warnings.md new file mode 100644 index 00000000000..52fe5dffad1 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/configuration-file/warnings.md @@ -0,0 +1,16 @@ +# Warnings + +By default, chezmoi will warn you when it encounters potential problems. Some of +these warnings can be suppressed by setting values in configuration file. + +| Variable | Type | Default | Description | +| ------------------------------ | ---- | ------- | ---------------------------------------------- | +| `configFileTemplateHasChanged` | bool | `true` | Warn when the config file template has changed | + + +!!! example + + ```toml title="~/.config/chezmoi/chezmoi.toml" + [warnings] + configFileTemplateHasChanged = false + ``` diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index 65f9bd809e8..d9608a4b8b1 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -109,6 +109,7 @@ nav: - pinentry: reference/configuration-file/pinentry.md - textconv: reference/configuration-file/textconv.md - umask: reference/configuration-file/umask.md + - Warnings: reference/configuration-file/warnings.md - Special files and directories: - reference/special-files-and-directories/index.md - .chezmoi.&lt;format&gt;.tmpl: reference/special-files-and-directories/chezmoi-format-tmpl.md diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 640d452fbf9..98883385066 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -69,6 +69,10 @@ type templateConfig struct { Options []string `mapstructure:"options"` } +type warningsConfig struct { + ConfigFileTemplateHasChanged bool `mapstructure:"configFileTemplateHasChanged"` +} + // ConfigFile contains all data settable in the config file. type ConfigFile struct { // Global configuration. @@ -91,6 +95,7 @@ type ConfigFile struct { UseBuiltinAge autoBool `mapstructure:"useBuiltinAge"` UseBuiltinGit autoBool `mapstructure:"useBuiltinGit"` Verbose bool `mapstructure:"verbose"` + Warnings warningsConfig `mapstructure:"warnings"` WorkingTreeAbsPath chezmoi.AbsPath `mapstructure:"workingTree"` // Password manager configurations. @@ -480,7 +485,7 @@ func (c *Config) applyArgs( return err } } - } else { + } else if c.Warnings.ConfigFileTemplateHasChanged { c.errorf("warning: config file template has changed, run chezmoi init to regenerate config file\n") } } @@ -2153,6 +2158,9 @@ func newConfigFile(bds *xdg.BaseDirectorySpecification) ConfigFile { UseBuiltinGit: autoBool{ auto: true, }, + Warnings: warningsConfig{ + ConfigFileTemplateHasChanged: true, + }, // Password manager configurations. Bitwarden: bitwardenConfig{ diff --git a/pkg/cmd/testdata/scripts/configstate.txtar b/pkg/cmd/testdata/scripts/configstate.txtar index 1c78711b279..c7d389fed69 100644 --- a/pkg/cmd/testdata/scripts/configstate.txtar +++ b/pkg/cmd/testdata/scripts/configstate.txtar @@ -14,6 +14,13 @@ cp golden/.chezmoi.toml.tmpl $CHEZMOISOURCEDIR/.chezmoi.toml.tmpl exec chezmoi apply stderr 'warning: config file template has changed' +# test that chezmoi apply does not print the warning if it is suppressed +appendline $CHEZMOICONFIGDIR/chezmoi.toml '[warnings]' +appendline $CHEZMOICONFIGDIR/chezmoi.toml ' configFileTemplateHasChanged = false' +exec chezmoi apply +! stderr . +cp golden/chezmoi.toml $CHEZMOICONFIGDIR + # test that chezmoi init re-generates the config file exec chezmoi init cmp $CHEZMOICONFIGDIR/chezmoi.toml golden/chezmoi.toml
feat
Add option to suppress warnings
8131e3f509b8091071922db0898f9e1c9c1d9ecf
2025-01-15 21:29:04
Tom Payne
docs: Add link to article
false
diff --git a/assets/chezmoi.io/docs/links/articles.md.yaml b/assets/chezmoi.io/docs/links/articles.md.yaml index 2b00002f7f4..9c623aa718a 100644 --- a/assets/chezmoi.io/docs/links/articles.md.yaml +++ b/assets/chezmoi.io/docs/links/articles.md.yaml @@ -485,3 +485,7 @@ articles: lang: JP title: 'chezmoiでdotfilesを管理する' url: https://devops-blog.virtualtech.jp/entry/20241219/1734585262 +- date: '2025-01-03' + version: 2.57.0 + title: 'Frictionless Dotfile Management With Chezmoi' + url: https://marcusb.org/posts/2025/01/frictionless-dotfile-management-with-chezmoi/
docs
Add link to article
baac6fc23bbfe34019ec71b4d0380ad896a3868f
2022-02-18 04:32:21
Tom Payne
feat: Support arguments in Windows SHELL environment variable
false
diff --git a/pkg/cmd/cdcmd.go b/pkg/cmd/cdcmd.go index e88481169ee..6ab3c218347 100644 --- a/pkg/cmd/cdcmd.go +++ b/pkg/cmd/cdcmd.go @@ -1,6 +1,8 @@ package cmd import ( + "os/exec" + "github.com/spf13/cobra" "github.com/twpayne/go-shell" ) @@ -30,9 +32,36 @@ func (c *Config) newCDCmd() *cobra.Command { } func (c *Config) runCDCmd(cmd *cobra.Command, args []string) error { + shellCommand, shellArgs := c.shell() + return c.run(c.WorkingTreeAbsPath, shellCommand, shellArgs) +} + +func (c *Config) shell() (string, []string) { shellCommand := c.CD.Command - if shellCommand == "" { - shellCommand, _ = shell.CurrentUserShell() + shellArgs := c.CD.Args + + // If the user has set a shell command then use it. + if shellCommand != "" { + return shellCommand, shellArgs + } + + // Determine the user's shell. + shellCommand, _ = shell.CurrentUserShell() + + // If the shell is found, return it. + if path, err := exec.LookPath(shellCommand); err == nil { + return path, shellArgs } - return c.run(c.WorkingTreeAbsPath, shellCommand, c.CD.Args) + + // Otherwise, if the shell contains spaces, then assume that the first word + // is the editor and the rest are arguments. + components := whitespaceRx.Split(shellCommand, -1) + if len(components) > 1 { + if path, err := exec.LookPath(components[0]); err == nil { + return path, append(components[1:], shellArgs...) + } + } + + // Fallback to shell command only. + return shellCommand, shellArgs } diff --git a/pkg/cmd/main_test.go b/pkg/cmd/main_test.go index a8b861126ab..f9d929c0e74 100644 --- a/pkg/cmd/main_test.go +++ b/pkg/cmd/main_test.go @@ -646,16 +646,6 @@ func setup(env *testscript.Env) error { `done`, )), }, - // shell is a non-interactive script that appends the directory in - // which it was launched to $WORK/shell.log. - "shell": &vfst.File{ - Perm: 0o755, - Contents: []byte(chezmoitest.JoinLines( - `#!/bin/sh`, - ``, - `pwd >> '`+filepath.Join(env.WorkDir, "shell.log")+`'`, - )), - }, } } diff --git a/pkg/cmd/testdata/scripts/cd_unix.txt b/pkg/cmd/testdata/scripts/cd_unix.txt index fee13bcac39..6569cc3093b 100644 --- a/pkg/cmd/testdata/scripts/cd_unix.txt +++ b/pkg/cmd/testdata/scripts/cd_unix.txt @@ -1,5 +1,7 @@ [windows] skip 'UNIX only' +chmod 755 bin/shell + # test chezmoi cd creates source directory if needed chezmoi cd exists $CHEZMOISOURCEDIR @@ -9,15 +11,23 @@ grep -count=1 ${CHEZMOISOURCEDIR@R} shell.log chezmoi cd grep -count=2 ${CHEZMOISOURCEDIR@R} shell.log -[!exec:bash] stop 'remaining tests require bash in $PATH' +# test that chezmoi cd works when $SHELL environment variable contains spaces +env SHELL='shell arg1' +chezmoi cd +stdout '^shell arg1$' chhome home2/user -# test chezmoi cd with command with args +# test chezmoi cd with shell command set in config file overrides $SHELL environment variable chezmoi cd -stdout version +stdout '^shell arg2$' + +-- bin/shell -- +#!/bin/sh +pwd >> $WORK/shell.log +echo shell $* -- home2/user/.config/chezmoi/chezmoi.toml -- [cd] - command = "bash" - args = ["--version"] + command = "shell" + args = ["arg2"] diff --git a/pkg/cmd/testdata/scripts/cd_windows.txt b/pkg/cmd/testdata/scripts/cd_windows.txt index 305db5c528d..ed414720f19 100644 --- a/pkg/cmd/testdata/scripts/cd_windows.txt +++ b/pkg/cmd/testdata/scripts/cd_windows.txt @@ -1,11 +1,21 @@ [!windows] skip 'Windows only' -# test chezmoi cd with command with args (Windows variant) +# test chezmoi cd with command with args chezmoi cd ! stdout PowerShell -stdout evidence +stdout arg1 +chhome home2/user + +# test chezmoi cd when $SHELL environment variable contains spaces +env SHELL='shell arg2' +chezmoi cd +stdout 'arg2' + +-- bin/shell.cmd -- +@echo off +echo %* -- home/user/.config/chezmoi/chezmoi.toml -- [cd] command = "powershell" - args = ["-nologo", "-command", "Write-Host 'evidence'"] + args = ["-nologo", "-command", "Write-Host 'arg1'"] diff --git a/pkg/cmd/testdata/scripts/doctor_unix.txt b/pkg/cmd/testdata/scripts/doctor_unix.txt index 861976749ea..32775ff95e7 100644 --- a/pkg/cmd/testdata/scripts/doctor_unix.txt +++ b/pkg/cmd/testdata/scripts/doctor_unix.txt @@ -11,6 +11,7 @@ chmod 755 bin/op chmod 755 bin/pass chmod 755 bin/pinentry chmod 755 bin/secret +chmod 755 bin/shell chmod 755 bin/vault chmod 755 bin/vimdiff @@ -126,6 +127,8 @@ echo "This is free software: you are free to change and redistribute it." echo "There is NO WARRANTY, to the extent permitted by law." -- bin/secret -- #!/bin/sh +-- bin/shell -- +#!/bin/sh -- bin/vault -- #!/bin/sh
feat
Support arguments in Windows SHELL environment variable
eb35f63d80e87167a88d88943ec8a7760ebe6237
2023-12-19 04:06:50
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 81b8f7b14fc..c34ea842cb7 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ 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.16.0 + golang.org/x/crypto v0.17.0 golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 golang.org/x/oauth2 v0.15.0 golang.org/x/sync v0.5.0 diff --git a/go.sum b/go.sum index a694163a90d..00e86709d45 100644 --- a/go.sum +++ b/go.sum @@ -365,8 +365,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +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/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
chore
Update dependencies
262e0d352d070fe78e2cd277c359d136cb5e3662
2023-02-15 01:09:52
Tom Payne
feat: Add --with-stdin flag to execute-template 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 ada18a55553..0146aecdb6c 100644 --- a/assets/chezmoi.io/docs/reference/commands/execute-template.md +++ b/assets/chezmoi.io/docs/reference/commands/execute-template.md @@ -42,6 +42,11 @@ Set the right template delimiter. Simulate the `stdinIsATTY` function by returning *bool*. +## `--with-stdin` + +If run with arguments, then set `.chezmoi.stdin` to the contents of the standard +input. + !!! example ```console diff --git a/pkg/cmd/executetemplatecmd.go b/pkg/cmd/executetemplatecmd.go index 74f70c1f539..c28ed698b65 100644 --- a/pkg/cmd/executetemplatecmd.go +++ b/pkg/cmd/executetemplatecmd.go @@ -18,6 +18,7 @@ type executeTemplateCmdConfig struct { promptString map[string]string stdinIsATTY bool templateOptions chezmoi.TemplateOptions + withStdin bool } func (c *Config) newExecuteTemplateCmd() *cobra.Command { @@ -40,6 +41,7 @@ func (c *Config) newExecuteTemplateCmd() *cobra.Command { flags.BoolVar(&c.executeTemplate.stdinIsATTY, "stdinisatty", c.executeTemplate.stdinIsATTY, "Simulate stdinIsATTY") flags.StringVar(&c.executeTemplate.templateOptions.LeftDelimiter, "left-delimiter", c.executeTemplate.templateOptions.LeftDelimiter, "Set left template delimiter") //nolint:lll flags.StringVar(&c.executeTemplate.templateOptions.RightDelimiter, "right-delimiter", c.executeTemplate.templateOptions.RightDelimiter, "Set right template delimiter") //nolint:lll + flags.BoolVar(&c.executeTemplate.withStdin, "with-stdin", c.executeTemplate.withStdin, "Set .chezmoi.stdin to the contents of the standard input") //nolint:lll return executeTemplateCmd } @@ -51,6 +53,17 @@ func (c *Config) runExecuteTemplateCmd(cmd *cobra.Command, args []string) error if c.executeTemplate.init { options = append(options, chezmoi.WithReadTemplateData(false)) } + if c.executeTemplate.withStdin && len(args) > 0 { + stdin, err := io.ReadAll(c.stdin) + if err != nil { + return err + } + options = append(options, chezmoi.WithPriorityTemplateData(map[string]any{ + "chezmoi": map[string]any{ + "stdin": string(stdin), + }, + })) + } sourceState, err := c.newSourceState(cmd.Context(), options...) if err != nil { return err diff --git a/pkg/cmd/testdata/scripts/executetemplate.txtar b/pkg/cmd/testdata/scripts/executetemplate.txtar index acf71a75a48..763cff4fe8a 100644 --- a/pkg/cmd/testdata/scripts/executetemplate.txtar +++ b/pkg/cmd/testdata/scripts/executetemplate.txtar @@ -7,6 +7,11 @@ stdin golden/stdin.tmpl exec chezmoi execute-template stdout stdin-template +# test reading from stdin with an argument +stdin golden/stdin +exec chezmoi execute-template --with-stdin '{{ .chezmoi.stdin | upper }}' +stdout '# CONTENTS OF STDIN' + # test partial templates work exec chezmoi execute-template '{{ template "partial" }}' stdout 'hello world' @@ -77,6 +82,8 @@ stdout value exec chezmoi execute-template --init '{{ promptString "value" "default" }}' stdout default +-- golden/stdin -- +# contents of stdin -- golden/stdin.tmpl -- {{ "stdin-template" }} -- home/user/.config/chezmoi/chezmoi.toml --
feat
Add --with-stdin flag to execute-template command
ffbb36718ad32fdc631aa08d61f1fce409f675a7
2022-08-18 20:07:32
Tom Payne
feat: Add gitHubLatestTag template function
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 ef8ce87b3e9..fad00d1d3eb 100644 --- a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md +++ b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestRelease.md @@ -1,12 +1,12 @@ -# `gitHubLatestRelease` *user-repo* +# `gitHubLatestRelease` *owner-repo* `gitHubLatestRelease` calls the GitHub API to retrieve the latest release about -the given *user-repo*, returning structured data as defined by the [GitHub Go +the given *owner-repo*, returning structured data as defined by the [GitHub Go API -bindings](https://pkg.go.dev/github.com/google/go-github/v41/github#RepositoryRelease). +bindings](https://pkg.go.dev/github.com/google/go-github/v45/github#RepositoryRelease). Calls to `gitHubLatestRelease` are cached so calling `gitHubLatestRelease` with -the same *user-repo* will only result in one call to the GitHub API. +the same *owner-repo* will only result in one call to the GitHub API. !!! example diff --git a/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md new file mode 100644 index 00000000000..1bf88eeb595 --- /dev/null +++ b/assets/chezmoi.io/docs/reference/templates/github-functions/gitHubLatestTag.md @@ -0,0 +1,22 @@ +# `gitHubLatestTag` *owner-repo* + +`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/v45/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. + +!!! example + + ``` + {{ (gitHubLatestTag "docker/compose").Name }} + ``` + +!!! warning + + The `gitHubLatestTag` returns the first tag returned by the [list + repository tags GitHub API + endpoint](https://docs.github.com/en/rest/repos/repos#list-repository-tags). + Although this seems to be the most recent tag, the GitHub API documentation + does not specify the order of the returned tags. diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index a824cc45834..1abeb6a89b6 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -189,6 +189,7 @@ nav: - reference/templates/github-functions/index.md - gitHubKeys: reference/templates/github-functions/gitHubKeys.md - gitHubLatestRelease: reference/templates/github-functions/gitHubLatestRelease.md + - gitHubLatestTag: reference/templates/github-functions/gitHubLatestTag.md - Init functions: - reference/templates/init-functions/index.md - exit: reference/templates/init-functions/exit.md diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 64ca42bf23a..5a10661cc24 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -444,6 +444,7 @@ func newConfig(options ...configOption) (*Config, error) { "fromYaml": c.fromYamlTemplateFunc, "gitHubKeys": c.gitHubKeysTemplateFunc, "gitHubLatestRelease": c.gitHubLatestReleaseTemplateFunc, + "gitHubLatestTag": c.gitHubLatestTagTemplateFunc, "glob": c.globTemplateFunc, "gopass": c.gopassTemplateFunc, "gopassRaw": c.gopassRawTemplateFunc, diff --git a/pkg/cmd/githubtemplatefuncs.go b/pkg/cmd/githubtemplatefuncs.go index 062c76593df..c2a9f8c6b09 100644 --- a/pkg/cmd/githubtemplatefuncs.go +++ b/pkg/cmd/githubtemplatefuncs.go @@ -11,8 +11,11 @@ import ( ) type gitHubData struct { + client *github.Client + clientErr error keysCache map[string][]*github.Key latestReleaseCache map[string]map[string]*github.RepositoryRelease + latestTagCache map[string]map[string]*github.RepositoryTag } func (c *Config) gitHubKeysTemplateFunc(user string) []*github.Key { @@ -23,11 +26,10 @@ func (c *Config) gitHubKeysTemplateFunc(user string) []*github.Key { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - httpClient, err := c.getHTTPClient() + gitHubClient, err := c.getGitHubClient(ctx) if err != nil { panic(err) } - gitHubClient := chezmoi.NewGitHubClient(ctx, httpClient) var allKeys []*github.Key opts := &github.ListOptions{ @@ -53,25 +55,24 @@ func (c *Config) gitHubKeysTemplateFunc(user string) []*github.Key { } func (c *Config) gitHubLatestReleaseTemplateFunc(userRepo string) *github.RepositoryRelease { - user, repo, ok := strings.Cut(userRepo, "/") - if !ok { - panic(fmt.Errorf("%s: not a user/repo", userRepo)) + owner, repo, err := gitHubSplitOwnerRepo(userRepo) + if err != nil { + panic(err) } - if release := c.gitHub.latestReleaseCache[user][repo]; release != nil { + if release := c.gitHub.latestReleaseCache[owner][repo]; release != nil { return release } ctx, cancel := context.WithCancel(context.Background()) defer cancel() - httpClient, err := c.getHTTPClient() + gitHubClient, err := c.getGitHubClient(ctx) if err != nil { panic(err) } - gitHubClient := chezmoi.NewGitHubClient(ctx, httpClient) - release, _, err := gitHubClient.Repositories.GetLatestRelease(ctx, user, repo) + release, _, err := gitHubClient.Repositories.GetLatestRelease(ctx, owner, repo) if err != nil { panic(err) } @@ -79,10 +80,73 @@ func (c *Config) gitHubLatestReleaseTemplateFunc(userRepo string) *github.Reposi if c.gitHub.latestReleaseCache == nil { c.gitHub.latestReleaseCache = make(map[string]map[string]*github.RepositoryRelease) } - if c.gitHub.latestReleaseCache[user] == nil { - c.gitHub.latestReleaseCache[user] = make(map[string]*github.RepositoryRelease) + if c.gitHub.latestReleaseCache[owner] == nil { + c.gitHub.latestReleaseCache[owner] = make(map[string]*github.RepositoryRelease) } - c.gitHub.latestReleaseCache[user][repo] = release + c.gitHub.latestReleaseCache[owner][repo] = release return release } + +func (c *Config) gitHubLatestTagTemplateFunc(userRepo string) *github.RepositoryTag { + owner, repo, err := gitHubSplitOwnerRepo(userRepo) + if err != nil { + panic(err) + } + + if tag, ok := c.gitHub.latestTagCache[owner][repo]; ok { + return tag + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + gitHubClient, err := c.getGitHubClient(ctx) + if err != nil { + panic(err) + } + + tags, _, err := gitHubClient.Repositories.ListTags(ctx, owner, repo, &github.ListOptions{ + PerPage: 1, + }) + if err != nil { + panic(err) + } + var firstTag *github.RepositoryTag + if len(tags) > 0 { + firstTag = tags[0] + } + + if c.gitHub.latestTagCache == nil { + c.gitHub.latestTagCache = make(map[string]map[string]*github.RepositoryTag) + } + if c.gitHub.latestTagCache[owner] == nil { + c.gitHub.latestTagCache[owner] = make(map[string]*github.RepositoryTag) + } + c.gitHub.latestTagCache[owner][repo] = firstTag + + return firstTag +} + +func (c *Config) getGitHubClient(ctx context.Context) (*github.Client, error) { + if c.gitHub.client != nil || c.gitHub.clientErr != nil { + return c.gitHub.client, c.gitHub.clientErr + } + + httpClient, err := c.getHTTPClient() + if err != nil { + c.gitHub.clientErr = err + return nil, err + } + + c.gitHub.client = chezmoi.NewGitHubClient(ctx, httpClient) + return c.gitHub.client, nil +} + +func gitHubSplitOwnerRepo(userRepo string) (string, string, error) { + user, repo, ok := strings.Cut(userRepo, "/") + if !ok { + return "", "", fmt.Errorf("%s: not a user/repo", userRepo) + } + return user, repo, nil +}
feat
Add gitHubLatestTag template function
70546ad981e11369a824608f2c3ab8b0afa2a70a
2025-01-23 08:45:34
Fool's Tech
docs: Update pruneEmptyDicts example
false
diff --git a/assets/chezmoi.io/docs/reference/templates/functions/pruneEmptyDicts.md b/assets/chezmoi.io/docs/reference/templates/functions/pruneEmptyDicts.md index e1ebbbb005a..c37d03a9027 100644 --- a/assets/chezmoi.io/docs/reference/templates/functions/pruneEmptyDicts.md +++ b/assets/chezmoi.io/docs/reference/templates/functions/pruneEmptyDicts.md @@ -7,5 +7,5 @@ empty dicts are pruned. !!! example ``` - {{ dict "key" "value" inner (dict) | pruneEmptyDicts | toJson }} + {{ dict "key" "value" "inner" (dict) | pruneEmptyDicts | toJson }} ```
docs
Update pruneEmptyDicts example
84afa19e32e5be40d49b2fa0c8335e65ee615811
2022-08-23 20:42:57
Tom Payne
fix: Handle .chezmoiroot in init command
false
diff --git a/pkg/cmd/initcmd.go b/pkg/cmd/initcmd.go index abe8525da54..30a9dc60e5b 100644 --- a/pkg/cmd/initcmd.go +++ b/pkg/cmd/initcmd.go @@ -207,6 +207,12 @@ func (c *Config) runInitCmd(cmd *cobra.Command, args []string) error { return err } + var err error + c.SourceDirAbsPath, err = c.sourceDirAbsPath() + if err != nil { + return err + } + if err := c.createAndReloadConfigFile(); err != nil { return err } diff --git a/pkg/cmd/initcmd_test.go b/pkg/cmd/initcmd_test.go index f7a5d543c93..0e69c0cbe0e 100644 --- a/pkg/cmd/initcmd_test.go +++ b/pkg/cmd/initcmd_test.go @@ -1,6 +1,7 @@ package cmd import ( + "runtime" "testing" "github.com/stretchr/testify/assert" @@ -124,3 +125,22 @@ func TestIssue2137(t *testing.T) { require.ErrorAs(t, err, &tooOldError) }) } + +func TestIssue2283(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping UNIX test on Windows") + } + chezmoitest.WithTestFS(t, map[string]any{ + "/home/user/.local/share/chezmoi": map[string]any{ + ".chezmoiroot": "home", + "home": map[string]any{ + ".chezmoi.yaml.tmpl": "sourceDir: {{ .chezmoi.sourceDir }}\n", + }, + }, + }, func(fileSystem vfs.FS) { + require.NoError(t, newTestConfig(t, fileSystem).execute([]string{"init"})) + data, err := fileSystem.ReadFile("/home/user/.config/chezmoi/chezmoi.yaml") + require.NoError(t, err) + assert.Equal(t, "sourceDir: /home/user/.local/share/chezmoi/home\n", string(data)) + }) +} diff --git a/pkg/cmd/testdata/scripts/issue2283.txtar b/pkg/cmd/testdata/scripts/issue2283.txtar new file mode 100644 index 00000000000..7dc588da076 --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue2283.txtar @@ -0,0 +1,10 @@ +# test that sourceDir has the correct value in chezmoi init with .chezmoiroot +exec chezmoi init +cmpenv $CHEZMOICONFIGDIR/chezmoi.yaml golden/chezmoi.yaml + +-- golden/chezmoi.yaml -- +sourceDir: $CHEZMOISOURCEDIR/home +-- home/user/.local/share/chezmoi/.chezmoiroot -- +home +-- home/user/.local/share/chezmoi/home/.chezmoi.yaml.tmpl -- +sourceDir: {{ .chezmoi.sourceDir }}
fix
Handle .chezmoiroot in init command
0fa8558246af4e1d53ab5f23ea4dd27c0e419268
2021-10-26 02:26:15
Tom Payne
chore: Make CodeQL analysis rely on fast changes check
false
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 1f0d53ac86b..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: codeql - -on: - push: - branches: - - master - pull_request: - branches: - - master - schedule: - - cron: "0 3 * * 4" - -jobs: - analyze: - runs-on: ubuntu-18.04 - permissions: - security-events: write - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: go - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8170510d6f3..f822709c2f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,6 +27,23 @@ jobs: - '**/*.go' - 'go.*' - 'internal/**' + codeql: + needs: changes + if: needs.changes.outputs.code == 'true' + runs-on: ubuntu-18.04 + permissions: + security-events: write + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: go + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 test-archlinux: needs: changes if: needs.changes.outputs.code == 'true'
chore
Make CodeQL analysis rely on fast changes check
3f36946b7a778568a44c2739204a3e02a286b027
2022-02-25 04:26:23
Tom Payne
docs: Document extracting a single file from an archive
false
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 d109fca43b4..05d32ac744c 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 @@ -131,6 +131,28 @@ You can customize the arguments to `git clone` and `git pull` by setting the chezmoi's support for `git-repo` externals currently requires `git` to be in your `$PATH`. +## 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: + +```toml title="~/.local/share/chezmoi/.chezmoiexternal.toml" +{{ ageVersion := "1.0.0" -}} +[".local/bin/age"] + type = "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"] +``` + +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. + ## Import archives It is occasionally useful to import entire archives of configuration into your
docs
Document extracting a single file from an archive
d7098659640ea277ff60006511c7f30bceb17fd9
2022-06-23 05:58:01
Tom Payne
chore: Fix generation of release notes
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d805159a357..fa4c5dbfb0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -398,6 +398,8 @@ jobs: sudo apt-get update sudo apt-get -yq --no-install-suggests --no-install-recommends install musl-tools snapcraft - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b + with: + fetch-depth: 0 - uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 with: cache: true
chore
Fix generation of release notes
13fe7a9660d57ac348fa62caead682b03a163699
2023-07-19 00:57:07
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 24579f14fd9..8eeaaf6c59f 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/Shopify/ejson v1.4.1 github.com/alecthomas/assert/v2 v2.3.0 - github.com/aws/aws-sdk-go-v2 v1.18.1 - github.com/aws/aws-sdk-go-v2/config v1.18.27 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.10 + github.com/aws/aws-sdk-go-v2 v1.19.0 + github.com/aws/aws-sdk-go-v2/config v1.18.28 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.11 github.com/bmatcuk/doublestar/v4 v4.6.0 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.16.1 @@ -26,7 +26,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/combinator v0.3.0 github.com/muesli/termenv v0.15.2 - github.com/pelletier/go-toml/v2 v2.0.8 + github.com/pelletier/go-toml/v2 v2.0.9 github.com/rogpeppe/go-internal v1.11.0 github.com/rs/zerolog v1.29.1 github.com/sergi/go-diff v1.1.0 @@ -42,7 +42,7 @@ require ( go.etcd.io/bbolt v1.3.7 go.uber.org/multierr v1.11.0 golang.org/x/crypto v0.11.0 - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 golang.org/x/oauth2 v0.10.0 golang.org/x/sync v0.3.0 golang.org/x/sys v0.10.0 @@ -57,21 +57,21 @@ require ( 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 - github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect github.com/acomagu/bufpipe v1.0.4 // indirect github.com/alecthomas/chroma v0.10.0 // indirect github.com/alecthomas/repr v0.2.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.26 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.27 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.12.13 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.19.3 // 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 @@ -105,7 +105,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/microcosm-cc/bluemonday v1.0.24 // indirect + github.com/microcosm-cc/bluemonday v1.0.25 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect diff --git a/go.sum b/go.sum index 9578ef126f2..474aaf02151 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb h1:RU+Ff2vE68zFQSoBqlb/LChFztEWWJ9EZ8LU4gA3ubU= -github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/Shopify/ejson v1.4.1 h1:zGGojGJNTdIWza/kOT8gd2HKCg3ZkSi3CZ1ZX70NHsw= github.com/Shopify/ejson v1.4.1/go.mod h1:VZMUtDzvBW/PAXRUF5fzp1ffb1ucT8MztrZXXLYZurw= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= @@ -36,30 +36,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.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= -github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= -github.com/aws/aws-sdk-go-v2/config v1.18.27/go.mod h1:0My+YgmkGxeqjXZb5BYme5pc4drjTnM+x1GJ3zv42Nw= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RKyZrOPO3V4DobiTUk= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 h1:A5UqQEmPaCFpedKouS4v+dHCTUo2sKqhoKO9U5kxyWo= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKKu6ZGXaq6FuFg5NzgQBAM6g8Y4= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.10 h1:eW8zPSh7ZLzb7029xCsIEFbnxLvNHPTt7aWwdKjNJc8= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.10/go.mod h1:ezn6mzIRqTPdAbDpm03dx4y9g6rvGRb2q33wS76dCxw= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 h1:XFJ2Z6sNUUcAz9poj+245DMkrHE4h2j5I9/xD50RHfE= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/oZqi6NPIhoR+uF7GeMU9eg= +github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= +github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2/config v1.18.28 h1:TINEaKyh1Td64tqFvn09iYpKiWjmHYrG1fa91q2gnqw= +github.com/aws/aws-sdk-go-v2/config v1.18.28/go.mod h1:nIL+4/8JdAuNHEjn/gPEXqtnS02Q3NXB/9Z7o5xE4+A= +github.com/aws/aws-sdk-go-v2/credentials v1.13.27 h1:dz0yr/yR1jweAnsCx+BmjerUILVPQ6FS5AwF/OyG1kA= +github.com/aws/aws-sdk-go-v2/credentials v1.13.27/go.mod h1:syOqAek45ZXZp29HlnRS/BNgMIW6uiRmeuQsz4Qh2UE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5 h1:kP3Me6Fy3vdi+9uHd7YLr6ewPxRL+PU6y15urfTaamU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5/go.mod h1:Gj7tm95r+QsDoN2Fhuz/3npQvcZbkEf5mL70n3Xfluc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 h1:hMUCiE3Zi5AHrRNGf5j985u0WyqI6r2NULhUfo0N/No= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 h1:yOpYx+FTBdpk/g+sBU6Cb1H0U/TLEcYYp66mYqsPpcc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36 h1:8r5m1BoAWkn0TDC34lUculryf7nUF25EgIMdjvGCkgo= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36/go.mod h1:Rmw2M1hMVTwiUhjwMoIBFWFJMhvJbct06sSidxInkhY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 h1:IiDolu/eLmuB18DRZibj77n1hHQT7z12jnGO7Ze3pLc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.11 h1:g2uwGxEXNsjd2OJHIW1KrP4q/BAUcyn6440LQ9gR+nQ= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.11/go.mod h1:ywwMMBG8ioLfw1LccY05t/egwONbtwDkoUVuXNgDZjs= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.13 h1:sWDv7cMITPcZ21QdreULwxOOAmE05JjEsT6fCDtDA9k= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.13/go.mod h1:DfX0sWuT46KpcqbMhJ9QWtxAIP1VozkDWf8VAkByjYY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13 h1:BFubHS/xN5bjl818QaroN6mQdjneYQ+AOx44KNXlyH4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13/go.mod h1:BzqsVVFduubEmzrVtUFQQIQdFqvUItF8XUq2EnS8Wog= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.3 h1:e5mnydVdCVWxP+5rPAGi2PYxC7u2OZgH1ypC114H04U= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.3/go.mod h1:yVGZA1CPkmUhBdA039jXNJJG7/6t+G+EBWmFq23xqnY= 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 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg= @@ -220,8 +220,8 @@ github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= -github.com/microcosm-cc/bluemonday v1.0.24 h1:NGQoPtwGVcbGkKfvyYk1yRqknzBuoMiUrO6R7uFTPlw= -github.com/microcosm-cc/bluemonday v1.0.24/go.mod h1:ArQySAMps0790cHSkdPEJ7bGkF2VePWH773hsJNSHf8= +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/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= @@ -247,8 +247,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb 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= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= @@ -306,8 +306,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +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/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-pinentry v0.2.0 h1:hS5NEJiilop9xP9pBX/1NYduzDlGGMdg1KamTBTrOWw= @@ -351,8 +351,8 @@ 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.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= +golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= 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.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
chore
Update dependencies
301f2a0a6da5dca14e3005f47c5df4c88e2f819f
2023-04-05 17:07:19
Tom Payne
chore: Build with Go 1.20.3
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 478c796dcc1..4eae06bd2a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: - v* env: AGE_VERSION: 1.1.1 - GO_VERSION: 1.20.2 + GO_VERSION: 1.20.3 GOFUMPT_VERSION: 0.4.0 GOLANGCI_LINT_VERSION: 1.52.1 GOVERSIONINFO_VERSION: 1.4.0
chore
Build with Go 1.20.3
e2ab069717ccf8bd5cfa746156a69236a52e44b9
2022-01-29 23:06:47
Tom Payne
chore: Rename variables for consistency
false
diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 1b0a6ba965a..9dc1d64ef1e 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -793,12 +793,12 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { } // Read all source entries. - var allSourceStateEntriesLock sync.Mutex + var allSourceStateEntriesMu sync.Mutex allSourceStateEntries := make(map[RelPath][]SourceStateEntry) addSourceStateEntries := func(relPath RelPath, sourceStateEntries ...SourceStateEntry) { - allSourceStateEntriesLock.Lock() + allSourceStateEntriesMu.Lock() allSourceStateEntries[relPath] = append(allSourceStateEntries[relPath], sourceStateEntries...) - allSourceStateEntriesLock.Unlock() + allSourceStateEntriesMu.Unlock() } walkFunc := func(ctx context.Context, sourceAbsPath AbsPath, fileInfo fs.FileInfo, err error) error { if err != nil { @@ -1902,12 +1902,12 @@ func (s *SourceState) readExternalFile( func (s *SourceState) readScriptsDir( ctx context.Context, scriptsDirAbsPath AbsPath, ) (map[RelPath][]SourceStateEntry, error) { - var allSourceStateEntriesLock sync.Mutex + var allSourceStateEntriesMu sync.Mutex allSourceStateEntries := make(map[RelPath][]SourceStateEntry) addSourceStateEntry := func(relPath RelPath, sourceStateEntry SourceStateEntry) { - allSourceStateEntriesLock.Lock() + allSourceStateEntriesMu.Lock() allSourceStateEntries[relPath] = append(allSourceStateEntries[relPath], sourceStateEntry) - allSourceStateEntriesLock.Unlock() + allSourceStateEntriesMu.Unlock() } walkFunc := func(ctx context.Context, sourceAbsPath AbsPath, fileInfo fs.FileInfo, err error) error { if err != nil {
chore
Rename variables for consistency
75c9befd44b835223da32f4d43a6da47c77ad3a2
2023-12-13 05:41:21
Tom Payne
chore: Add commit message linter
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4c34f98698..952fd660afe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -303,6 +303,8 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + with: + fetch-depth: 0 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 with: go-version: ${{ env.GO_VERSION }} @@ -327,6 +329,14 @@ jobs: run: | go install "github.com/twpayne/find-typos@v${FIND_TYPOS_VERSION}" find-typos -format=github-actions chezmoi . + - name: lint-commit-messages + if: github.event_name == 'push' + run: | + go run ./internal/cmds/lint-commit-messages HEAD~1..HEAD + - name: lint-commit-messages + if: github.event_name == 'pull_request' + run: | + go run ./internal/cmds/lint-commit-messages ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}..${{ github.event.pull_request.head.sha }} lint: needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' diff --git a/Makefile b/Makefile index 4790d2b2a9f..4c8681fbcda 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,7 @@ lint: ensure-actionlint ensure-find-typos ensure-golangci-lint ${GO} run ./internal/cmds/lint-whitespace find . -name \*.txtar | xargs ${GO} run ./internal/cmds/lint-txtar ./bin/find-typos chezmoi . + go run ./internal/cmds/lint-commit-messages origin/master..HEAD .PHONY: format format: ensure-gofumpt ensure-golines diff --git a/internal/cmds/lint-commit-messages/main.go b/internal/cmds/lint-commit-messages/main.go new file mode 100644 index 00000000000..69925c8c891 --- /dev/null +++ b/internal/cmds/lint-commit-messages/main.go @@ -0,0 +1,49 @@ +package main + +import ( + "bufio" + "bytes" + "fmt" + "os" + "os/exec" + "regexp" + "strings" +) + +var commitRx = regexp.MustCompile(`\A([0-9a-f]{40}) (chore(?:\(\w+\))?|docs|feat|fix): `) + +func run() error { + args := append([]string{"log", "--format=oneline"}, os.Args[1:]...) + cmd := exec.Command("git", args...) + cmd.Stdin = os.Stdin + cmd.Stderr = os.Stderr + output, err := cmd.Output() + if err != nil { + return fmt.Errorf("git: %w", err) + } + + var invalidCommitMessages []string + scanner := bufio.NewScanner(bytes.NewReader(output)) + for scanner.Scan() { + commitMessage := scanner.Text() + if !commitRx.MatchString(commitMessage) { + invalidCommitMessages = append(invalidCommitMessages, commitMessage) + } + } + if err := scanner.Err(); err != nil { + return fmt.Errorf("scanner: %w", err) + } + + if len(invalidCommitMessages) != 0 { + return fmt.Errorf("invalid commit messages:\n%s", strings.Join(invalidCommitMessages, "\n")) + } + + return nil +} + +func main() { + if err := run(); err != nil { + fmt.Println(err) + os.Exit(1) + } +}
chore
Add commit message linter
20132395fc55416a1cc2e1300065da8de7e50a21
2022-03-31 20:16:08
Tom Payne
chore: Always pass --quiet to keepassxc-cli
false
diff --git a/pkg/cmd/keepassxctemplatefuncs.go b/pkg/cmd/keepassxctemplatefuncs.go index beec38f211d..8fc241c03a4 100644 --- a/pkg/cmd/keepassxctemplatefuncs.go +++ b/pkg/cmd/keepassxctemplatefuncs.go @@ -39,7 +39,7 @@ func (c *Config) keepassxcAttachmentTemplateFunc(entry, name string) string { return data } - args := []string{"attachment-export", "--stdout"} + args := []string{"attachment-export", "--stdout", "--quiet"} args = append(args, c.Keepassxc.Args...) args = append(args, c.Keepassxc.Database.String(), entry, name) @@ -56,11 +56,11 @@ func (c *Config) keepassxcTemplateFunc(entry string) map[string]string { return data } - args := []string{"show"} version, err := c.keepassxcVersion() if err != nil { panic(err) } + args := []string{"show", "--quiet"} if version.Compare(keepassxcNeedShowProtectedArgVersion) >= 0 { args = append(args, "--show-protected") } diff --git a/pkg/cmd/testdata/scripts/keepassxc.txt b/pkg/cmd/testdata/scripts/keepassxc.txt index a0ba4a4e905..7dfafdc5b51 100644 --- a/pkg/cmd/testdata/scripts/keepassxc.txt +++ b/pkg/cmd/testdata/scripts/keepassxc.txt @@ -23,10 +23,10 @@ case "$*" in "--version") echo "2.5.4" ;; -"attachment-export --stdout /secrets.kdbx example.com attachment") +"attachment-export --stdout --quiet /secrets.kdbx example.com attachment") echo "# contents of attachment" ;; -"show --show-protected /secrets.kdbx example.com") +"show --quiet --show-protected /secrets.kdbx example.com") cat <<EOF Title: example.com UserName: examplelogin @@ -46,9 +46,9 @@ esac @echo off IF "%*" == "--version" ( echo 2.5.4 -) ELSE IF "%*" == "attachment-export --stdout C:/secrets.kdbx example.com attachment" ( +) ELSE IF "%*" == "attachment-export --stdout --quiet C:/secrets.kdbx example.com attachment" ( echo.# contents of attachment -) ELSE IF "%*" == "show --show-protected C:/secrets.kdbx example.com" ( +) ELSE IF "%*" == "show --quiet --show-protected C:/secrets.kdbx example.com" ( echo.Title: example.com echo.UserName: examplelogin echo.Password: examplepassword
chore
Always pass --quiet to keepassxc-cli
4f76edb5295068569d7c6311020ac0094c77ef44
2024-03-31 23:42:53
Tom Payne
chore: Update golangci-lint config
false
diff --git a/.golangci.yml b/.golangci.yml index ce9636d9e70..30a7f2d246f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -42,6 +42,7 @@ linters: - ireturn - loggercheck - makezero + - mirror - misspell - nilerr - noctx @@ -77,6 +78,7 @@ linters: disable: - asasalint - contextcheck + - copyloopvar - cyclop - depguard - dupl
chore
Update golangci-lint config
ca8fe5bfcb148741d2763d93ce0d562e04fa3ae3
2025-02-08 02:09:08
Tom Payne
fix: Fix crash when excluding types
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 57c5beec499..617c67df4d0 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -704,6 +704,9 @@ func (s *SourceState) Apply( options ApplyOptions, ) error { sourceStateEntry := s.root.get(targetRelPath) + if sourceStateEntry == nil { + return nil + } if !options.Filter.IncludeSourceStateEntry(sourceStateEntry) { return nil
fix
Fix crash when excluding types
994a0c73def0f83fedae4680389ac7eb212b12fe
2022-09-18 00:13:45
Tom Payne
feat: Always set and restore Windows console
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index c4a0de5ccca..548ad1f92db 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -193,6 +193,8 @@ type Config struct { tempDirs map[string]chezmoi.AbsPath ioregData ioregData + + restoreWindowsConsole func() error } // A configOption sets and option on a Config. @@ -1578,6 +1580,12 @@ func (c *Config) persistentPostRunRootE(cmd *cobra.Command, args []string) error } } + if c.restoreWindowsConsole != nil { + if err := c.restoreWindowsConsole(); err != nil { + return err + } + } + return nil } @@ -1628,6 +1636,14 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error } } + if runtime.GOOS == "windows" { + var err error + c.restoreWindowsConsole, err = enableVirtualTerminalProcessing(c.stdout) + if err != nil { + return err + } + } + // Read the config file. if err := c.readConfig(); err != nil { if !boolAnnotation(cmd, doesNotRequireValidConfig) { @@ -1636,19 +1652,11 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.errorf("warning: %s: %v\n", c.configFileAbsPath, err) } - // Determine whether color should be used. - color := c.Color.Value(c.colorAutoFunc) - if color { - if err := enableVirtualTerminalProcessing(c.stdout); err != nil { - return err - } - } - // Configure the logger. log.Logger = log.Output(zerolog.NewConsoleWriter( func(w *zerolog.ConsoleWriter) { w.Out = c.stderr - w.NoColor = !color + w.NoColor = !c.Color.Value(c.colorAutoFunc) w.TimeFormat = time.RFC3339 }, )) diff --git a/pkg/cmd/util_unix.go b/pkg/cmd/util_unix.go index f28b00fda5a..22ef2ee4d30 100644 --- a/pkg/cmd/util_unix.go +++ b/pkg/cmd/util_unix.go @@ -15,9 +15,9 @@ const defaultEditor = "vi" var defaultInterpreters = make(map[string]*chezmoi.Interpreter) -// enableVirtualTerminalProcessing does nothing. -func enableVirtualTerminalProcessing(w io.Writer) error { - return nil +// enableVirtualTerminalProcessing does nothing on non-Windows systems. +func enableVirtualTerminalProcessing(w io.Writer) (func() error, error) { + return nil, nil } func fileInfoUID(info fs.FileInfo) int { diff --git a/pkg/cmd/util_windows.go b/pkg/cmd/util_windows.go index a9f180acdd1..a03f249fc6e 100644 --- a/pkg/cmd/util_windows.go +++ b/pkg/cmd/util_windows.go @@ -33,21 +33,35 @@ var defaultInterpreters = map[string]*chezmoi.Interpreter{ }, } -// enableVirtualTerminalProcessing enables virtual terminal processing. See +// enableVirtualTerminalProcessing enables virtual terminal processing on +// Windows systems. See // https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences. -func enableVirtualTerminalProcessing(w io.Writer) error { +// It returns a function that restores the console to the previous state. +func enableVirtualTerminalProcessing(w io.Writer) (func() error, error) { file, ok := w.(*os.File) if !ok { - return nil + return nil, nil } + var dwMode uint32 if err := windows.GetConsoleMode(windows.Handle(file.Fd()), &dwMode); err != nil { - return nil // Ignore error in the case that fd is not a terminal. + // Ignore error in the case that fd is not a terminal. + return nil, nil + } + + if dwMode&windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING == windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING { + // If virtual terminal processing is already enabled, then there is + // nothing to do. + return nil, nil } + if err := windows.SetConsoleMode(windows.Handle(file.Fd()), dwMode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err != nil { - return fmt.Errorf("windows.SetConsoleMode: %w", err) + return nil, fmt.Errorf("windows.SetConsoleMode: %w", err) } - return nil + + return func() error { + return windows.SetConsoleMode(windows.Handle(file.Fd()), dwMode) + }, nil } func fileInfoUID(fs.FileInfo) int {
feat
Always set and restore Windows console
75969065e1c5b72c09afd69fc7f77b06cad07d0d
2021-10-03 04:19:07
Tom Payne
chore: Document more internal functions
false
diff --git a/internal/chezmoi/ageencryption.go b/internal/chezmoi/ageencryption.go index a8546c614b6..e9aae07d793 100644 --- a/internal/chezmoi/ageencryption.go +++ b/internal/chezmoi/ageencryption.go @@ -98,6 +98,7 @@ func (e *AgeEncryption) EncryptedSuffix() string { return e.Suffix } +// builtinDecrypt decrypts ciphertext using the builtin age. func (e *AgeEncryption) builtinDecrypt(ciphertext []byte) ([]byte, error) { identities, err := e.builtinIdentities() if err != nil { @@ -114,6 +115,7 @@ func (e *AgeEncryption) builtinDecrypt(ciphertext []byte) ([]byte, error) { return w.Bytes(), err } +// builtinEncrypt encrypts ciphertext using the builtin age. func (e *AgeEncryption) builtinEncrypt(plaintext []byte) ([]byte, error) { recipients, err := e.builtinRecipients() if err != nil { @@ -137,6 +139,8 @@ func (e *AgeEncryption) builtinEncrypt(plaintext []byte) ([]byte, error) { return output.Bytes(), nil } +// builtinIdentities returns the identities for decryption using the builtin +// age. func (e *AgeEncryption) builtinIdentities() ([]age.Identity, error) { var identities []age.Identity if !e.Identity.Empty() { @@ -156,6 +160,8 @@ func (e *AgeEncryption) builtinIdentities() ([]age.Identity, error) { return identities, nil } +// builtinRecipients returns the recipients for encryption using the builtin +// age. func (e *AgeEncryption) builtinRecipients() ([]age.Recipient, error) { recipients := make([]age.Recipient, 0, 1+len(e.Recipients)) if e.Recipient != "" { @@ -221,6 +227,7 @@ func (e *AgeEncryption) encryptArgs() []string { return args } +// identityArgs returns the arguments for identity. func (e *AgeEncryption) identityArgs() []string { args := make([]string, 0, 2+2*len(e.Identities)) if !e.Identity.Empty() { @@ -232,6 +239,8 @@ func (e *AgeEncryption) identityArgs() []string { return args } +// parseIdentityFile parses the identities from indentityFile using the builtin +// age. func parseIdentityFile(identityFile AbsPath) ([]age.Identity, error) { file, err := os.Open(identityFile.String()) if err != nil { @@ -241,6 +250,8 @@ func parseIdentityFile(identityFile AbsPath) ([]age.Identity, error) { return age.ParseIdentities(file) } +// parseRecipientFile parses the recipients from recipientFile using the builtin +// age. func parseRecipientsFile(recipientsFile AbsPath) ([]age.Recipient, error) { file, err := os.Open(recipientsFile.String()) if err != nil { diff --git a/internal/chezmoi/archivereadersystem.go b/internal/chezmoi/archivereadersystem.go index 9af5d93cd2a..be120e932b5 100644 --- a/internal/chezmoi/archivereadersystem.go +++ b/internal/chezmoi/archivereadersystem.go @@ -140,15 +140,18 @@ func (s *ArchiveReaderSystem) Readlink(name AbsPath) (string, error) { return "", fs.ErrNotExist } +// Set implements github.com/spf13/pflag.Value.Set. func (f *ArchiveFormat) Set(s string) error { *f = ArchiveFormat(s) return nil } +// String implements github.com/spf13/pflag.Value.String. func (f ArchiveFormat) String() string { return string(f) } +// Type implements github.com/spf13/pflag.Value.Type. func (f ArchiveFormat) Type() string { return "format" } diff --git a/internal/chezmoi/attr.go b/internal/chezmoi/attr.go index c32ab7a49e1..8d04d203c90 100644 --- a/internal/chezmoi/attr.go +++ b/internal/chezmoi/attr.go @@ -87,7 +87,8 @@ func parseDirAttr(sourceName string) DirAttr { } } -// MarshalZerologObject implements zerolog.Marshaler. +// MarshalZerologObject implements +// github.com/rs/zerolog.ObjectMarshaler.MarshalZerologObject. func (da DirAttr) MarshalZerologObject(e *zerolog.Event) { e.Str("targetName", da.TargetName) e.Bool("exact", da.Exact) @@ -259,7 +260,8 @@ func parseFileAttr(sourceName, encryptedSuffix string) FileAttr { } } -// MarshalZerologObject implements zerolog.ObjectMarshaler. +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (fa FileAttr) MarshalZerologObject(e *zerolog.Event) { e.Str("TargetName", fa.TargetName) e.Str("Type", sourceFileTypeStrs[fa.Type]) diff --git a/internal/chezmoi/boltpersistentstate.go b/internal/chezmoi/boltpersistentstate.go index e834491586b..9a7ab7d8849 100644 --- a/internal/chezmoi/boltpersistentstate.go +++ b/internal/chezmoi/boltpersistentstate.go @@ -200,6 +200,7 @@ func (b *BoltPersistentState) Set(bucket, key, value []byte) error { }) } +// open opens b's database if it is not already open, creating it if needed. func (b *BoltPersistentState) open() error { if b.db != nil { return nil diff --git a/internal/chezmoi/chezmoi_windows.go b/internal/chezmoi/chezmoi_windows.go index f0e3143166d..3a155029cdc 100644 --- a/internal/chezmoi/chezmoi_windows.go +++ b/internal/chezmoi/chezmoi_windows.go @@ -40,6 +40,7 @@ func isReadOnly(info fs.FileInfo) bool { return false } -func isSlash(c uint8) bool { +// isSlash returns if c is a slash character. +func isSlash(c byte) bool { return c == '\\' || c == '/' } diff --git a/internal/chezmoi/diff.go b/internal/chezmoi/diff.go index a0fd487b72d..dcb45d50ced 100644 --- a/internal/chezmoi/diff.go +++ b/internal/chezmoi/diff.go @@ -18,6 +18,8 @@ var gitDiffOperation = map[diffmatchpatch.Operation]diff.Operation{ diffmatchpatch.DiffInsert: diff.Add, } +// A gitDiffChunk implements the +// github.com/go-git/go-git/v5/plumbing/format/diff.Chunk interface. type gitDiffChunk struct { content string operation diff.Operation @@ -26,6 +28,8 @@ type gitDiffChunk struct { func (c *gitDiffChunk) Content() string { return c.content } func (c *gitDiffChunk) Type() diff.Operation { return c.operation } +// A gitDiffFile implements the +// github.com/go-git/go-git/v5/plumbing/format/diff.File interface. type gitDiffFile struct { hash plumbing.Hash fileMode filemode.FileMode @@ -36,6 +40,8 @@ func (f *gitDiffFile) Hash() plumbing.Hash { return f.hash } func (f *gitDiffFile) Mode() filemode.FileMode { return f.fileMode } func (f *gitDiffFile) Path() string { return string(f.relPath) } +// A gitDiffFilePatch implements the +// github.com/go-git/go-git/v5/plumbing/format/diff.FilePatch interface. type gitDiffFilePatch struct { isBinary bool from, to diff.File @@ -46,6 +52,8 @@ func (fp *gitDiffFilePatch) IsBinary() bool { return fp.isBinary func (fp *gitDiffFilePatch) Files() (diff.File, diff.File) { return fp.from, fp.to } func (fp *gitDiffFilePatch) Chunks() []diff.Chunk { return fp.chunks } +// A gitDiffPatch implements the +// github.com/go-git/go-git/v5/plumbing/format/diff.Patch interface. type gitDiffPatch struct { filePatches []diff.FilePatch message string diff --git a/internal/chezmoi/entrystate.go b/internal/chezmoi/entrystate.go index c37204b8b17..2aeade14725 100644 --- a/internal/chezmoi/entrystate.go +++ b/internal/chezmoi/entrystate.go @@ -65,6 +65,8 @@ func (s *EntryState) Overwrite() bool { return s.overwrite } +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (s *EntryState) MarshalZerologObject(e *zerolog.Event) { if s == nil { return diff --git a/internal/chezmoi/entrytypeset.go b/internal/chezmoi/entrytypeset.go index 989800013d4..da27f578431 100644 --- a/internal/chezmoi/entrytypeset.go +++ b/internal/chezmoi/entrytypeset.go @@ -130,6 +130,7 @@ func (s *EntryTypeSet) SetSlice(ss []string) error { return nil } +// String implements github.com/spf13/pflag.Value.String. func (s *EntryTypeSet) String() string { if s == nil { return "none" diff --git a/internal/chezmoi/gpgencryption.go b/internal/chezmoi/gpgencryption.go index 7014b88389c..75af134f47b 100644 --- a/internal/chezmoi/gpgencryption.go +++ b/internal/chezmoi/gpgencryption.go @@ -102,6 +102,7 @@ func (e *GPGEncryption) EncryptedSuffix() string { return e.Suffix } +// decryptArgs returns the arguments for decryption. func (e *GPGEncryption) decryptArgs(plaintextFilename, ciphertextFilename AbsPath) []string { args := []string{"--output", plaintextFilename.String()} args = append(args, e.Args...) @@ -109,6 +110,7 @@ func (e *GPGEncryption) decryptArgs(plaintextFilename, ciphertextFilename AbsPat return args } +// encryptArgs returns the arguments for encryption. func (e *GPGEncryption) encryptArgs(plaintextFilename, ciphertextFilename AbsPath) []string { args := []string{ "--armor", @@ -127,6 +129,7 @@ func (e *GPGEncryption) encryptArgs(plaintextFilename, ciphertextFilename AbsPat return args } +// run runs the command with args. func (e *GPGEncryption) run(args []string) error { //nolint:gosec cmd := exec.Command(e.Command, args...) diff --git a/internal/chezmoi/mode.go b/internal/chezmoi/mode.go index e93cd7b7198..88f45d17226 100644 --- a/internal/chezmoi/mode.go +++ b/internal/chezmoi/mode.go @@ -1,6 +1,7 @@ package chezmoi -// A Mode is a mode of operation. +// A Mode is a mode of operation. It implements the github.com/spf13/flag.Value +// interface. type Mode string // Modes. @@ -15,6 +16,7 @@ func (e invalidModeError) Error() string { return "invalid mode: " + string(e) } +// Set implements github.com/spf13/flag.Value.Set. func (m *Mode) Set(s string) error { switch Mode(s) { case ModeFile: @@ -28,10 +30,12 @@ func (m *Mode) Set(s string) error { } } +// String implements github.com/spf13/flag.Value.String. func (m Mode) String() string { return string(m) } +// Type implements github.com/spf13/flag.Value.Type. func (m Mode) Type() string { return "mode" } diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 8cada6772cc..15fc1e64b87 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -1071,6 +1071,8 @@ func (s *SourceState) executeTemplate(templateAbsPath AbsPath) ([]byte, error) { return s.ExecuteTemplateData(templateAbsPath.String(), data) } +// 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) ([]byte, error) { // FIXME be more intelligent about HTTP caching, e.g. following RFC 7234, // rather than blindly re-downloading each time diff --git a/internal/chezmoi/sourcestateentry.go b/internal/chezmoi/sourcestateentry.go index 92994f3ead5..bdb918dc395 100644 --- a/internal/chezmoi/sourcestateentry.go +++ b/internal/chezmoi/sourcestateentry.go @@ -51,7 +51,8 @@ func (s *SourceStateDir) Evaluate() error { return nil } -// MarshalZerologObject implements zerolog.LogObjectMarshaler. +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (s *SourceStateDir) MarshalZerologObject(e *zerolog.Event) { e.Stringer("sourceRelPath", s.sourceRelPath) e.Object("attr", s.Attr) @@ -78,7 +79,8 @@ func (s *SourceStateFile) Evaluate() error { return err } -// MarshalZerologObject implements zerolog.LogObjectMarshaler. +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (s *SourceStateFile) MarshalZerologObject(e *zerolog.Event) { e.Stringer("sourceRelPath", s.sourceRelPath) e.Interface("attr", s.Attr) @@ -144,7 +146,8 @@ func (s *SourceStateRenameDir) Evaluate() error { return nil } -// MarashalLogObject implements zerolog.LogObjectMarshaler. +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (s *SourceStateRenameDir) MarshalZerologObject(e *zerolog.Event) { e.Stringer("oldSourceRelPath", s.oldSourceRelPath) e.Stringer("newSourceRelPath", s.newSourceRelPath) diff --git a/internal/cmd/chattrcmd.go b/internal/cmd/chattrcmd.go index 3ced4b9bfc1..b7323f89b5d 100644 --- a/internal/cmd/chattrcmd.go +++ b/internal/cmd/chattrcmd.go @@ -127,6 +127,7 @@ func (c *Config) runChattrCmd(cmd *cobra.Command, args []string, sourceState *ch return nil } +// modify returns the modified value of b. func (m boolModifier) modify(b bool) bool { switch m { case boolModifierSet: @@ -140,6 +141,7 @@ func (m boolModifier) modify(b bool) bool { } } +// modify returns the modified value of order. func (m orderModifier) modify(order int) int { switch m { case orderModifierSetBefore: @@ -163,6 +165,7 @@ func (m orderModifier) modify(order int) int { } } +// parseAttrModifier parses the attrMmodifier from s. func parseAttrModifier(s string) (*attrModifier, error) { am := &attrModifier{} for _, modifierStr := range strings.Split(s, ",") { @@ -228,6 +231,7 @@ func parseAttrModifier(s string) (*attrModifier, error) { return am, nil } +// modifyDirAttr returns the modified value of dirAttr. func (am *attrModifier) modifyDirAttr(dirAttr chezmoi.DirAttr) chezmoi.DirAttr { return chezmoi.DirAttr{ TargetName: dirAttr.TargetName, @@ -237,6 +241,7 @@ func (am *attrModifier) modifyDirAttr(dirAttr chezmoi.DirAttr) chezmoi.DirAttr { } } +// modifyFileAttr returns the modified value of fileAttr. func (am *attrModifier) modifyFileAttr(fileAttr chezmoi.FileAttr) chezmoi.FileAttr { switch fileAttr.Type { case chezmoi.SourceFileTypeFile: diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index a9dc95a3c87..e6c576ca44b 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -85,6 +85,8 @@ func init() { } } +// MarshalZerologObject implements +// github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject. func (v VersionInfo) MarshalZerologObject(e *zerolog.Event) { e.Str("version", v.Version) e.Str("commit", v.Commit) diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 44e24d14dd8..ccf4a942862 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -426,6 +426,9 @@ func newConfig(options ...configOption) (*Config, error) { return c, nil } +// addTemplateFunc adds the template function with the key key and value value +// to c. It panics if there is already an existing template function with the +// same key. func (c *Config) addTemplateFunc(key string, value interface{}) { if _, ok := c.templateFuncs[key]; ok { panic(fmt.Sprintf("%s: already defined", key)) @@ -442,6 +445,10 @@ type applyArgsOptions struct { preApplyFunc chezmoi.PreApplyFunc } +// applyArgs is the core of all commands that make changes to a target system. +// It checks config file freshness, reads the source state, and then applies the +// source state for each target entry in args. If args is empty then the source +// state is applied to all target entries. func (c *Config) applyArgs(ctx context.Context, targetSystem chezmoi.System, targetDirAbsPath chezmoi.AbsPath, args []string, options applyArgsOptions) error { if options.init { if err := c.createAndReloadConfigFile(); err != nil { @@ -449,13 +456,8 @@ func (c *Config) applyArgs(ctx context.Context, targetSystem chezmoi.System, tar } } - sourceState, err := c.newSourceState(ctx) - if err != nil { - return err - } - var currentConfigTemplateContentsSHA256 []byte - configTemplateRelPath, _, configTemplateContents, err := c.findConfigTemplate() + configTemplateRelPath, _, configTemplateContents, err := c.findFirstConfigTemplate() if err != nil { return err } @@ -496,10 +498,9 @@ func (c *Config) applyArgs(ctx context.Context, targetSystem chezmoi.System, tar } } - applyOptions := chezmoi.ApplyOptions{ - Include: options.include.Sub(options.exclude), - PreApplyFunc: options.preApplyFunc, - Umask: options.umask, + sourceState, err := c.newSourceState(ctx) + if err != nil { + return err } var targetRelPaths []chezmoi.RelPath @@ -521,6 +522,12 @@ func (c *Config) applyArgs(ctx context.Context, targetSystem chezmoi.System, tar } } + applyOptions := chezmoi.ApplyOptions{ + Include: options.include.Sub(options.exclude), + PreApplyFunc: options.preApplyFunc, + Umask: options.umask, + } + //nolint:ifshort keptGoingAfterErr := false for _, targetRelPath := range targetRelPaths { @@ -541,6 +548,7 @@ func (c *Config) applyArgs(ctx context.Context, targetSystem chezmoi.System, tar return nil } +// close closes resources associated with c. func (c *Config) close() error { var err error for _, tempDirAbsPath := range c.tempDirs { @@ -555,6 +563,7 @@ func (c *Config) close() error { return err } +// cmdOutput returns the of running the command name with args in dirAbsPath. func (c *Config) cmdOutput(dirAbsPath chezmoi.AbsPath, name string, args []string) ([]byte, error) { cmd := exec.Command(name, args...) if !dirAbsPath.Empty() { @@ -567,6 +576,7 @@ func (c *Config) cmdOutput(dirAbsPath chezmoi.AbsPath, name string, args []strin return c.baseSystem.IdempotentCmdOutput(cmd) } +// colorAutoFunc detects whether color should be used. func (c *Config) colorAutoFunc() bool { if _, ok := os.LookupEnv("NO_COLOR"); ok { return false @@ -581,7 +591,7 @@ func (c *Config) colorAutoFunc() bool { // template and reloads it. func (c *Config) createAndReloadConfigFile() error { // Find config template, execute it, and create config file. - configTemplateRelPath, ext, configTemplateContents, err := c.findConfigTemplate() + configTemplateRelPath, ext, configTemplateContents, err := c.findFirstConfigTemplate() if err != nil { return err } @@ -696,6 +706,9 @@ func (c *Config) defaultConfigFile(fileSystem vfs.Stater, bds *xdg.BaseDirectory return configHomeAbsPath.Join("chezmoi", "chezmoi.toml"), nil } +// defaultPreApplyFunc is the default pre-apply function. If the target entry +// has changed since chezmoi last wrote it then it prompts the user for the +// action to take. func (c *Config) defaultPreApplyFunc(targetRelPath chezmoi.RelPath, targetEntryState, lastWrittenEntryState, actualEntryState *chezmoi.EntryState) error { log.Info(). Stringer("targetRelPath", targetRelPath). @@ -770,6 +783,7 @@ func (c *Config) defaultSourceDir(fileSystem vfs.Stater, bds *xdg.BaseDirectoryS return dataHomeAbsPath.Join("chezmoi"), nil } +// defaultTemplateData returns the default template data. func (c *Config) defaultTemplateData() map[string]interface{} { // Determine the user's username and group, if possible. // @@ -878,6 +892,9 @@ type destAbsPathInfosOptions struct { recursive bool } +// destAbsPathInfos returns the os/fs.FileInfos for each destination entry in +// args, recursing into subdirectories and following symlinks if configured in +// options. func (c *Config) destAbsPathInfos(sourceState *chezmoi.SourceState, args []string, options destAbsPathInfosOptions) (map[chezmoi.AbsPath]fs.FileInfo, error) { destAbsPathInfos := make(map[chezmoi.AbsPath]fs.FileInfo) for _, arg := range args { @@ -928,6 +945,8 @@ func (c *Config) destAbsPathInfos(sourceState *chezmoi.SourceState, args []strin return destAbsPathInfos, nil } +// diffFile outputs the diff between fromData and fromMode and toData and toMode +// at path. func (c *Config) diffFile(path chezmoi.RelPath, fromData []byte, fromMode fs.FileMode, toData []byte, toMode fs.FileMode) error { var sb strings.Builder unifiedEncoder := diff.NewUnifiedEncoder(&sb, diff.DefaultContextLines) @@ -945,6 +964,8 @@ func (c *Config) diffFile(path chezmoi.RelPath, fromData []byte, fromMode fs.Fil return c.pageOutputString(sb.String(), c.Diff.Pager) } +// doPurge is the core purge functionality. It removes all files and directories +// associated with chezmoi. func (c *Config) doPurge(purgeOptions *purgeOptions) error { if c.persistentState != nil { if err := c.persistentState.Close(); err != nil { @@ -1039,10 +1060,12 @@ func (c *Config) editor() (string, []string) { return editor, nil } +// errorf writes an error to stderr. func (c *Config) errorf(format string, args ...interface{}) { fmt.Fprintf(c.stderr, "chezmoi: "+format, args...) } +// execute creates a new root command and executes it with args. func (c *Config) execute(args []string) error { rootCmd, err := c.newRootCmd() if err != nil { @@ -1088,7 +1111,9 @@ func (c *Config) filterInput(args []string, f func([]byte) ([]byte, error)) erro return nil } -func (c *Config) findConfigTemplate() (chezmoi.RelPath, string, []byte, error) { +// findFirstConfigTemplate searches for a config template, returning the path, +// format, and contents of the first one that it finds. +func (c *Config) findFirstConfigTemplate() (chezmoi.RelPath, string, []byte, error) { for _, ext := range viper.SupportedExts { filename := chezmoi.RelPath(chezmoi.Prefix + "." + ext + chezmoi.TemplateSuffix) contents, err := c.baseSystem.ReadFile(c.SourceDirAbsPath.Join(filename)) @@ -1103,6 +1128,7 @@ func (c *Config) findConfigTemplate() (chezmoi.RelPath, string, []byte, error) { return "", "", nil, nil } +// gitAutoAdd adds all changes to the git index and returns the new git status. func (c *Config) gitAutoAdd() (*git.Status, error) { if err := c.run(c.WorkingTreeAbsPath, c.Git.Command, []string{"add", "."}); err != nil { return nil, err @@ -1114,6 +1140,8 @@ func (c *Config) gitAutoAdd() (*git.Status, error) { return git.ParseStatusPorcelainV2(output) } +// gitAutoCommit commits all changes in the git index, including generating a +// commit message from status. func (c *Config) gitAutoCommit(status *git.Status) error { if status.Empty() { return nil @@ -1133,6 +1161,7 @@ func (c *Config) gitAutoCommit(status *git.Status) error { return c.run(c.WorkingTreeAbsPath, c.Git.Command, []string{"commit", "--message", commitMessage.String()}) } +// gitAutoPush pushes all changes to the remote if status is not empty. func (c *Config) gitAutoPush(status *git.Status) error { if status.Empty() { return nil @@ -1140,6 +1169,8 @@ func (c *Config) gitAutoPush(status *git.Status) error { return c.run(c.WorkingTreeAbsPath, c.Git.Command, []string{"push"}) } +// makeRunEWithSourceState returns a function for +// github.com/spf13/cobra.Command.RunE that includes reading the source state. func (c *Config) makeRunEWithSourceState(runE func(*cobra.Command, []string, *chezmoi.SourceState) error) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { sourceState, err := c.newSourceState(cmd.Context()) @@ -1150,6 +1181,7 @@ func (c *Config) makeRunEWithSourceState(runE func(*cobra.Command, []string, *ch } } +// marshal formats data in dataFormat and writes it to the standard output. func (c *Config) marshal(dataFormat writeDataFormat, data interface{}) error { var format chezmoi.Format switch dataFormat { @@ -1167,6 +1199,7 @@ func (c *Config) marshal(dataFormat writeDataFormat, data interface{}) error { return c.writeOutput(marshaledData) } +// newRootCmd returns a new root github.com/spf13/cobra.Command. func (c *Config) newRootCmd() (*cobra.Command, error) { rootCmd := &cobra.Command{ Use: "chezmoi", @@ -1279,6 +1312,7 @@ func (c *Config) newRootCmd() (*cobra.Command, error) { return rootCmd, nil } +// newSourceState returns a new SourceState with options. func (c *Config) newSourceState(ctx context.Context, options ...chezmoi.SourceStateOption) (*chezmoi.SourceState, error) { s := chezmoi.NewSourceState(append([]chezmoi.SourceStateOption{ chezmoi.WithBaseSystem(c.baseSystem), @@ -1308,6 +1342,7 @@ func (c *Config) newSourceState(ctx context.Context, options ...chezmoi.SourceSt return s, nil } +// persistentPostRunRootE performs post-run actions for the root command. func (c *Config) persistentPostRunRootE(cmd *cobra.Command, args []string) error { if err := c.persistentState.Close(); err != nil { return err @@ -1351,6 +1386,7 @@ func (c *Config) persistentPostRunRootE(cmd *cobra.Command, args []string) error return nil } +// pageOutputString writes output using cmdPager as the pager command. func (c *Config) pageOutputString(output, cmdPager string) error { pager := firstNonEmptyString(cmdPager, c.Pager) if c.noPager || pager == "" { @@ -1373,7 +1409,9 @@ func (c *Config) pageOutputString(output, cmdPager string) error { return pagerCmd.Run() } +// persistentPreRunRootE performs pre-run actions for the root command. func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error { + // Enable CPU profiling if configured. if !c.cpuProfile.Empty() { f, err := os.Create(c.cpuProfile.String()) if err != nil { @@ -1384,12 +1422,14 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error } } + // Enable gops if configured. if c.gops { if err := agent.Listen(agent.Options{}); err != nil { return err } } + // Read the config file. if err := c.readConfig(); err != nil { if !boolAnnotation(cmd, doesNotRequireValidConfig) { return fmt.Errorf("invalid config: %s: %w", c.configFileAbsPath, err) @@ -1397,6 +1437,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.errorf("warning: %s: %v\n", c.configFileAbsPath, err) } + // Determine whether color should be used. color := c.Color.Value(c.colorAutoFunc) if color { if err := enableVirtualTerminalProcessing(c.stdout); err != nil { @@ -1404,6 +1445,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error } } + // Configure the logger. log.Logger = log.Output(zerolog.NewConsoleWriter( func(w *zerolog.ConsoleWriter) { w.Out = c.stderr @@ -1417,6 +1459,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error zerolog.SetGlobalLevel(zerolog.Disabled) } + // Log basic information. log.Info(). Object("version", c.versionInfo). Strs("args", args). @@ -1430,6 +1473,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.baseSystem = chezmoi.NewDebugSystem(c.baseSystem) } + // Set up the persistent state. switch { case cmd.Annotations[persistentStateMode] == persistentStateModeEmpty: c.persistentState = chezmoi.NewMockPersistentState() @@ -1477,6 +1521,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.persistentState = chezmoi.NewDebugPersistentState(c.persistentState) } + // Set up the source and destination systems. c.sourceSystem = c.baseSystem c.destSystem = c.baseSystem if !boolAnnotation(cmd, modifiesDestinationDirectory) { @@ -1494,6 +1539,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.destSystem = chezmoi.NewGitDiffSystem(c.destSystem, c.stdout, c.DestDirAbsPath, color) } + // Set up encryption. switch c.Encryption { case "age": // Only use builtin age encryption if age encryption is explicitly @@ -1523,18 +1569,21 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error c.encryption = chezmoi.NewDebugEncryption(c.encryption) } + // Create the config directory if needed. if boolAnnotation(cmd, requiresConfigDirectory) { if err := chezmoi.MkdirAll(c.baseSystem, c.configFileAbsPath.Dir(), 0o777); err != nil { return err } } + // Create the source directory if needed. if boolAnnotation(cmd, requiresSourceDirectory) { if err := chezmoi.MkdirAll(c.baseSystem, c.SourceDirAbsPath, 0o777); err != nil { return err } } + // Create the runtime directory if needed. if boolAnnotation(cmd, runsCommands) { if runtime.GOOS == "linux" && c.bds.RuntimeDir != "" { // Snap sets the $XDG_RUNTIME_DIR environment variable to @@ -1549,6 +1598,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error } } + // Determine the working tree directory if it is not configured. if c.WorkingTreeAbsPath.Empty() { workingTreeAbsPath := c.SourceDirAbsPath FOR: @@ -1566,6 +1616,7 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error } } + // Create the working tree directory if needed. if boolAnnotation(cmd, requiresWorkingTree) { if _, err := c.SourceDirAbsPath.TrimDirPrefix(c.WorkingTreeAbsPath); err != nil { return err @@ -1578,6 +1629,9 @@ func (c *Config) persistentPreRunRootE(cmd *cobra.Command, args []string) error return nil } +// persistentStateFile returns the absolute path to the persistent state file, +// returning the first persistent file found, and returning the default path if +// none are found. func (c *Config) persistentStateFile() (chezmoi.AbsPath, error) { if !c.configFileAbsPath.Empty() { return c.configFileAbsPath.Dir().Join(persistentStateFilename), nil @@ -1599,6 +1653,7 @@ func (c *Config) persistentStateFile() (chezmoi.AbsPath, error) { return defaultConfigFileAbsPath.Dir().Join(persistentStateFilename), nil } +// promptChoice prompts the user for one of choices until a valid choice is made. func (c *Config) promptChoice(prompt string, choices []string) (string, error) { promptWithChoices := fmt.Sprintf("%s [%s]? ", prompt, strings.Join(choices, ",")) abbreviations := uniqueAbbreviations(choices) @@ -1613,6 +1668,7 @@ func (c *Config) promptChoice(prompt string, choices []string) (string, error) { } } +// readConfig reads the config file, if it exists. func (c *Config) readConfig() error { viper.SetConfigFile(c.configFileAbsPath.String()) if c.configFormat != "" { @@ -1631,6 +1687,7 @@ func (c *Config) readConfig() error { return c.validateData() } +// readLine reads a line from stdin. func (c *Config) readLine(prompt string) (string, error) { _, err := c.stdout.Write([]byte(prompt)) if err != nil { @@ -1643,6 +1700,7 @@ func (c *Config) readLine(prompt string) (string, error) { return strings.TrimSuffix(line, "\n"), nil } +// run runs name with args in dir. func (c *Config) run(dir chezmoi.AbsPath, name string, args []string) error { cmd := exec.Command(name, args...) if !dir.Empty() { @@ -1658,6 +1716,7 @@ func (c *Config) run(dir chezmoi.AbsPath, name string, args []string) error { return c.baseSystem.RunCmd(cmd) } +// runEditor runs the configured editor with args. func (c *Config) runEditor(args []string) error { if err := c.persistentState.Close(); err != nil { return err @@ -1666,6 +1725,8 @@ func (c *Config) runEditor(args []string) error { return c.run(chezmoi.EmptyAbsPath, editor, append(editorArgs, args...)) } +// sourceAbsPaths returns the source absolute paths for each target path in +// args. func (c *Config) sourceAbsPaths(sourceState *chezmoi.SourceState, args []string) ([]chezmoi.AbsPath, error) { targetRelPaths, err := c.targetRelPaths(sourceState, args, targetRelPathsOptions{ mustBeInSourceState: true, @@ -1686,6 +1747,8 @@ type targetRelPathsOptions struct { recursive bool } +// targetRelPaths returns the target relative paths for each target path in +// args. func (c *Config) targetRelPaths(sourceState *chezmoi.SourceState, args []string, options targetRelPathsOptions) ([]chezmoi.RelPath, error) { targetRelPaths := make([]chezmoi.RelPath, 0, len(args)) for _, arg := range args { @@ -1708,7 +1771,8 @@ func (c *Config) targetRelPaths(sourceState *chezmoi.SourceState, args []string, targetRelPaths = append(targetRelPaths, targetRelPath) if options.recursive { parentRelPath := targetRelPath - // FIXME we should not call s.TargetRelPaths() here - risk of accidentally quadratic + // FIXME we should not call s.TargetRelPaths() here - risk of + // accidentally quadratic for _, targetRelPath := range sourceState.TargetRelPaths() { if _, err := targetRelPath.TrimDirPrefix(parentRelPath); err == nil { targetRelPaths = append(targetRelPaths, targetRelPath) @@ -1735,6 +1799,8 @@ func (c *Config) targetRelPaths(sourceState *chezmoi.SourceState, args []string, return targetRelPaths[:n], nil } +// targetRelPathsBySourcePath returns the target relative paths for each arg in +// args. 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) @@ -1783,6 +1849,7 @@ func (c *Config) tempDir(key string) (chezmoi.AbsPath, error) { return tempDirAbsPath, nil } +// useBuiltinAgeAutoFunc detects whether the builtin age should be used. func (c *Config) useBuiltinAgeAutoFunc() bool { if _, err := exec.LookPath(c.Age.Command); err == nil { return false @@ -1790,6 +1857,7 @@ func (c *Config) useBuiltinAgeAutoFunc() bool { return true } +// useBuiltinGitAutoFunc detects whether the builitin git should be used. func (c *Config) useBuiltinGitAutoFunc() bool { if _, err := exec.LookPath(c.Git.Command); err == nil { return false @@ -1797,10 +1865,12 @@ func (c *Config) useBuiltinGitAutoFunc() bool { return true } +// validateData valides that the config data does not contain any invalid keys. func (c *Config) validateData() error { return validateKeys(c.Data, identifierRx) } +// writeOutput writes data to the configured output. func (c *Config) writeOutput(data []byte) error { if c.outputAbsPath.Empty() || c.outputAbsPath == chezmoi.NewAbsPath("-") { _, err := c.stdout.Write(data) @@ -1809,6 +1879,7 @@ func (c *Config) writeOutput(data []byte) error { return c.baseSystem.WriteFile(c.outputAbsPath, data, 0o666) } +// writeOutputString writes data to the configured output. func (c *Config) writeOutputString(data string) error { return c.writeOutput([]byte(data)) } diff --git a/internal/cmd/config_unix.go b/internal/cmd/config_unix.go index c03ccce800a..65f88f50b52 100644 --- a/internal/cmd/config_unix.go +++ b/internal/cmd/config_unix.go @@ -10,6 +10,7 @@ import ( "golang.org/x/term" ) +// readPassword reads a password. func (c *Config) readPassword(prompt string) (string, error) { if c.noTTY { return c.readLine(prompt) diff --git a/internal/cmd/config_windows.go b/internal/cmd/config_windows.go index 6843b9eb957..84137b9e04f 100644 --- a/internal/cmd/config_windows.go +++ b/internal/cmd/config_windows.go @@ -7,6 +7,7 @@ import ( "golang.org/x/term" ) +// readPassword reads a password. func (c *Config) readPassword(prompt string) (string, error) { if c.noTTY { return c.readLine(prompt) diff --git a/internal/cmd/dataformat.go b/internal/cmd/dataformat.go index 10efda29245..a694ce70d95 100644 --- a/internal/cmd/dataformat.go +++ b/internal/cmd/dataformat.go @@ -28,6 +28,7 @@ const ( defaultWriteDataFormat = writeDataFormatJSON ) +// Set implements github.com/spf13/pflag.Value.Set. func (f *readDataFormat) Set(s string) error { switch strings.ToLower(s) { case "json": @@ -42,14 +43,17 @@ func (f *readDataFormat) Set(s string) error { return nil } +// String implements github.com/spf13/pflag.Value.String. func (f readDataFormat) String() string { return string(f) } +// Type implements github.com/spf13/pflag.Value.Type. func (f readDataFormat) Type() string { return "json|toml|yaml" } +// Set implements github.com/spf13/pflag.Value.Set. func (f *writeDataFormat) Set(s string) error { switch strings.ToLower(s) { case "json": @@ -62,10 +66,12 @@ func (f *writeDataFormat) Set(s string) error { return nil } +// String implements github.com/spf13/pflag.Value.String. func (f writeDataFormat) String() string { return string(f) } +// Type implements github.com/spf13/pflag.Value.Type. func (f writeDataFormat) Type() string { return "json|yaml" }
chore
Document more internal functions
e2899b81badce39a90a306559bad2c06b8e25d4f
2021-12-18 02:54:15
Tom Payne
feat: Improve inconsistent state error with removes
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 1c1fa2b2ab5..fb2a415f26d 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -411,7 +411,10 @@ DESTABSPATH: return nil } sourceRelPath := sourceStateEntry.SourceRelPath() - sourceRoot.Set(sourceRelPath.RelPath(), &SourceStateRemove{}) + sourceRoot.Set(sourceRelPath.RelPath(), &SourceStateRemove{ + sourceRelPath: sourceRelPath, + targetRelPath: targetRelPath, + }) update := sourceUpdate{ destAbsPath: s.destDirAbsPath.Join(targetRelPath), entryState: &EntryState{ @@ -784,6 +787,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { for _, match := range matches { targetRelPath := targetParentRelPath.JoinString(match) sourceStateEntry := &SourceStateRemove{ + sourceRelPath: sourceRelPath, targetRelPath: targetRelPath, } allSourceStateEntries[targetRelPath] = append(allSourceStateEntries[targetRelPath], sourceStateEntry) @@ -892,7 +896,8 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { continue } - switch sourceStateDir, ok := sourceStateEntries[0].(*SourceStateDir); { + sourceStateDir, ok := sourceStateEntries[0].(*SourceStateDir) + switch { case !ok: continue case !sourceStateDir.Attr.Exact: @@ -914,6 +919,7 @@ func (s *SourceState) Read(ctx context.Context, options *ReadOptions) error { continue } allSourceStateEntries[destEntryRelPath] = append(allSourceStateEntries[destEntryRelPath], &SourceStateRemove{ + sourceRelPath: sourceStateDir.sourceRelPath, targetRelPath: destEntryRelPath, }) } diff --git a/internal/chezmoi/sourcestate_test.go b/internal/chezmoi/sourcestate_test.go index 98b47123d5e..d31d270bc51 100644 --- a/internal/chezmoi/sourcestate_test.go +++ b/internal/chezmoi/sourcestate_test.go @@ -1141,6 +1141,7 @@ func TestSourceStateRead(t *testing.T) { }, }, NewRelPath("dir/file2"): &SourceStateRemove{ + sourceRelPath: NewSourceRelDirPath("exact_dir"), targetRelPath: NewRelPath("dir/file2"), }, }), @@ -1162,6 +1163,7 @@ func TestSourceStateRead(t *testing.T) { expectedSourceState: NewSourceState( withEntries(map[RelPath]SourceStateEntry{ NewRelPath("file"): &SourceStateRemove{ + sourceRelPath: NewSourceRelPath(".chezmoiremove"), targetRelPath: NewRelPath("file"), }, }), @@ -1182,6 +1184,7 @@ func TestSourceStateRead(t *testing.T) { expectedSourceState: NewSourceState( withEntries(map[RelPath]SourceStateEntry{ NewRelPath("file1"): &SourceStateRemove{ + sourceRelPath: NewSourceRelPath(".chezmoiremove"), targetRelPath: NewRelPath("file1"), }, }), diff --git a/internal/chezmoi/sourcestateentry.go b/internal/chezmoi/sourcestateentry.go index b4e4fe1181b..0e799ddb062 100644 --- a/internal/chezmoi/sourcestateentry.go +++ b/internal/chezmoi/sourcestateentry.go @@ -39,6 +39,7 @@ type SourceStateFile struct { // A SourceStateRemove represents that an entry should be removed. type SourceStateRemove struct { + sourceRelPath SourceRelPath targetRelPath RelPath } @@ -146,7 +147,7 @@ func (s *SourceStateRemove) Order() ScriptOrder { // Origin returns s's origin. func (s *SourceStateRemove) Origin() string { - return "" + return s.sourceRelPath.String() } // SourceRelPath returns s's source relative path. diff --git a/internal/cmd/testdata/scripts/edgecases.txt b/internal/cmd/testdata/scripts/edgecases.txt index 4b6c10dc291..40a1a75e663 100644 --- a/internal/cmd/testdata/scripts/edgecases.txt +++ b/internal/cmd/testdata/scripts/edgecases.txt @@ -35,7 +35,30 @@ mkdir $HOME/.dir chezmoi add $HOME${/}.dir/ ! exists $CHEZMOISOURCEDIR/dot_dir/dot_dir +chhome home3/user + +# test that chezmoi reports an inconsistent state error when a file should be both removed and present +! 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 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\)' + -- golden/.file -- # contents of .file -- home2/user/.local/share/chezmoi/dot_file -- # contents of .file +-- home3/user/.file -- +# contents of .file +-- home3/user/.local/share/chezmoi/.chezmoiremove -- +.file +-- home3/user/.local/share/chezmoi/dot_file -- +# contents of .file +-- home4/user/.local/share/chezmoi/.chezmoiremove -- +.file +-- home4/user/.local/share/chezmoi/dot_file -- +# contents of .file
feat
Improve inconsistent state error with removes
14b00a6f6473dbef7b793f8f1009f14e09d52137
2022-02-19 19:58:01
Tom Payne
chore: Add latest version check to doctor command
false
diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index e33191d628b..31437a6ac59 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -19,6 +19,12 @@ import ( "github.com/twpayne/chezmoi/v2/pkg/chezmoi" ) +// GitHub owner and repo for chezmoi itself. +const ( + gitHubOwner = "twpayne" + gitHubRepo = "chezmoi" +) + // Command annotations. const ( createSourceDirectoryIfNeeded = "chezmoi_create_source_directory_if_needed" diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 8476ea78e6e..46be6d852d7 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -388,8 +388,8 @@ func newConfig(options ...configOption) (*Config, error) { recursive: true, }, upgrade: upgradeCmdConfig{ - owner: "twpayne", - repo: "chezmoi", + owner: gitHubOwner, + repo: gitHubRepo, }, verify: verifyCmdConfig{ exclude: chezmoi.NewEntryTypeSet(chezmoi.EntryTypesNone), diff --git a/pkg/cmd/doctorcmd.go b/pkg/cmd/doctorcmd.go index b686b875c52..21e6f3613ea 100644 --- a/pkg/cmd/doctorcmd.go +++ b/pkg/cmd/doctorcmd.go @@ -2,9 +2,11 @@ package cmd import ( "bytes" + "context" "errors" "fmt" "io/fs" + "net/http" "os" "os/exec" "regexp" @@ -97,6 +99,15 @@ type fileCheck struct { // A goVersionCheck checks the Go version. type goVersionCheck struct{} +// A latestVersionCheck checks the latest version. +type latestVersionCheck struct { + httpClient *http.Client + httpClientErr error + owner string + repo string + version semver.Version +} + // An osArchCheck checks that runtime.GOOS and runtime.GOARCH are supported. type osArchCheck struct{} @@ -140,6 +151,7 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { if err != nil { return err } + httpClient, httpClientErr := c.getHTTPClient() shellCommand, _ := shell.CurrentUserShell() shellCommand, shellArgs := parseCommand(shellCommand, nil) cdCommand, cdArgs := c.cdCommand() @@ -149,6 +161,13 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error { versionInfo: c.versionInfo, versionStr: c.versionStr, }, + &latestVersionCheck{ + httpClient: httpClient, + httpClientErr: httpClientErr, + owner: gitHubOwner, + repo: gitHubRepo, + version: c.version, + }, osArchCheck{}, unameCheck{}, systeminfoCheck{}, @@ -509,6 +528,35 @@ func (goVersionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) return checkResultOK, fmt.Sprintf("%s (%s)", runtime.Version(), runtime.Compiler) } +func (c *latestVersionCheck) Name() string { + return "latest-version" +} + +func (c *latestVersionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath) (checkResult, string) { + if c.httpClientErr != nil { + return checkResultError, c.httpClientErr.Error() + } + + ctx := context.Background() + + gitHubClient := chezmoi.NewGitHubClient(ctx, c.httpClient) + rr, _, err := gitHubClient.Repositories.GetLatestRelease(ctx, c.owner, c.repo) + if err != nil { + return checkResultError, err.Error() + } + + version, err := semver.NewVersion(strings.TrimPrefix(rr.GetName(), "v")) + if err != nil { + return checkResultError, err.Error() + } + + checkResult := checkResultOK + if c.version.LessThan(*version) { + checkResult = checkResultWarning + } + return checkResult, "v" + version.String() +} + func (osArchCheck) Name() string { return "os-arch" } diff --git a/pkg/cmd/testdata/scripts/doctor_unix.txt b/pkg/cmd/testdata/scripts/doctor_unix.txt index 464eabfb7dc..fb259d4f1c9 100644 --- a/pkg/cmd/testdata/scripts/doctor_unix.txt +++ b/pkg/cmd/testdata/scripts/doctor_unix.txt @@ -21,6 +21,7 @@ mksourcedir # test that chezmoi doctor behaves as expected chezmoi doctor stdout '^ok\s+version\s+' +stdout '^warning\s+latest-version\s+' stdout '^ok\s+os-arch\s+' ! stdout '^\S+\s+systeminfo\s+' stdout '^ok\s+uname\s+'
chore
Add latest version check to doctor command
1e2e27610af674a452f46b97d749f72d8cf17f9a
2023-06-30 03:18:02
Tom Payne
chore: Update goreleaser config for version 1.19
false
diff --git a/.goreleaser.yaml b/.goreleaser.yaml index fb5efb3a91a..171ea77d066 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -94,7 +94,6 @@ archives: format_overrides: - goos: windows format: zip - rlcp: true - id: glibc builds: - chezmoi-cgo-glibc @@ -103,7 +102,6 @@ archives: - README.md - completions/* name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}-glibc_{{ .Arch }}' - rlcp: true - id: musl builds: - chezmoi-cgo-musl @@ -112,7 +110,6 @@ archives: - README.md - completions/* name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}-musl_{{ .Arch }}' - rlcp: true changelog: use: github-native @@ -207,7 +204,7 @@ release: name_template: chezmoi-windows-amd64.exe scoops: -- bucket: +- repository: owner: twpayne name: scoop-bucket token: '{{ .Env.SCOOP_GITHUB_TOKEN }}' @@ -249,4 +246,3 @@ source: prefix_template: '{{ .ProjectName }}-{{ .Version }}/' files: - COMMIT - rlcp: true
chore
Update goreleaser config for version 1.19
319dd20ba92418ca1845a7c53e3e0cac1b6e4347
2023-10-10 16:39:58
Tom Payne
docs: Tidy up release notes
false
diff --git a/assets/chezmoi.io/docs/reference/release-history.md.tmpl b/assets/chezmoi.io/docs/reference/release-history.md.tmpl index 2bfb630b1ac..c78f85605cc 100644 --- a/assets/chezmoi.io/docs/reference/release-history.md.tmpl +++ b/assets/chezmoi.io/docs/reference/release-history.md.tmpl @@ -1,13 +1,15 @@ # Release history -{{- range $release := gitHubListReleases "twpayne/chezmoi" }} + +{{- $releases := gitHubListReleases "twpayne/chezmoi" }} +{{- $lastReleaseIndex := sub (len $releases) 1 }} +{{- range $index, $release := $releases }} ## [{{ $release.Name | trimPrefix "v" }}]({{ $release.HTMLURL }}) ({{ $release.PublishedAt | gitHubTimestampFormat "2006-01-02" }}) {{ $release.Body - | replaceAllRegex "(?m)^## What's Changed$" "" - | replaceAllRegex "(?m)^## Changelog\\r?$" "" - | replaceAllRegex "(?m)^## (New Contributors)\\r?$" "$1\n" - | replaceAllRegex "\\*\\*(Full Changelog)\\*\\*" "$1" + | replaceAllRegex "(?m)^#+ (Changelog\\r?|What's Changed)$" "" + | replaceAllRegex "(?m)^#+ (.*)\\r?$" "\n\n$1\n" + | replaceAllRegex "\\*\\*(Full Changelog)\\*\\*.*\n" "" | replaceAllRegex "(https://github\\.com/twpayne/chezmoi/compare/(\\S+))" "[`$2`]($1)" | replaceAllRegex "@(\\S+)" "[**$0**](https://github.com/$1)" | replaceAllRegex "pull request #(\\d+)" "pull request https://github.com/twpayne/chezmoi/pull/$1" @@ -16,5 +18,14 @@ | replaceAllRegex "(?m)^([0-9a-f]{7,})" "* $1" | replaceAllRegex "(?m)^\\* ([0-9a-f]{7,})" "* [`$1`](https://github.com/twpayne/chezmoi/commit/$1)" | replaceAllRegex "\\r\\n" "\\n" + | trim + | default "Internal changes only" }} + +{{- if ne $index $lastReleaseIndex }} +{{- $prevRelease := index $releases (add $index 1) }} + +Full changelog: [{{ $prevRelease.Name }}...{{ $release.Name }}](https://github.com/twpayne/chezmoi/compare/{{ $prevRelease.Name }}...{{ $release.Name }}) +{{- end }} + {{- end }}
docs
Tidy up release notes
4c30f6a8a36b38e1b5c43123fc1068f83e98f51d
2024-04-04 14:51:03
Tom Payne
chore: Fix use of ireturn linter
false
diff --git a/.golangci.yml b/.golangci.yml index 30a7f2d246f..8c43a140557 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -137,6 +137,7 @@ linters-settings: ireturn: allow: - anon + - comparable - empty - error - github\.com/charmbracelet/bubbletea\.Model
chore
Fix use of ireturn linter
48973fd9da96fcc1b2d655c3d5632823c3b1e18d
2022-08-24 12:07:45
Tom Payne
chore: Remove faulty deploy-website step
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 028bb7c83a4..875bd688983 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -410,13 +410,3 @@ jobs: gh release upload v${VERSION} dist/checksums.txt env: GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} - deploy-website: - runs-on: ubuntu-20.04 - needs: - - release - steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - - name: install-website-dependencies - run: pip3 install mkdocs-material mkdocs-mermaid2-plugin mkdocs-redirects mkdocs-simple-hooks - - name: deploy-website - run: ( cd assets/chezmoi.io && mkdocs gh-deploy )
chore
Remove faulty deploy-website step
6eadaf3e1430252d6fb64de3378b8322f0757ee3
2024-05-14 02:44:16
Tom Payne
chore: Run golangci-lint on all OSes
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5662b16aea8..a89a5bcbce1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -368,13 +368,24 @@ jobs: run: | go run ./internal/cmds/lint-commit-messages ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}..${{ github.event.pull_request.head.sha }} lint: + name: lint-${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + runs-on: + - macos-14 + - ubuntu-22.04 + - windows-2022 needs: changes if: github.event_name == 'push' || needs.changes.outputs.code == 'true' - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.runs-on }} permissions: contents: read steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + with: + go-version: stable - uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 with: version: v${{ env.GOLANGCI_LINT_VERSION }}
chore
Run golangci-lint on all OSes
892a39230940ed5e1af3b6d6942676871545a58e
2022-09-23 20:31:46
Tom Payne
chore: Tidy up OS-specific files
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index e676dc0b6b7..47629624ab8 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -1047,7 +1047,7 @@ func (c *Config) defaultTemplateData() map[string]any { executable, _ := os.Executable() - windowsVersion, _ := c.windowsVersion() + windowsVersion, _ := windowsVersion() return map[string]any{ "chezmoi": map[string]any{ diff --git a/pkg/cmd/config_unix.go b/pkg/cmd/config_unix.go deleted file mode 100644 index f28cbd8044c..00000000000 --- a/pkg/cmd/config_unix.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !windows -// +build !windows - -package cmd - -func (c *Config) windowsVersion() (map[string]any, error) { - return nil, nil -} diff --git a/pkg/cmd/config_windows.go b/pkg/cmd/config_windows.go deleted file mode 100644 index 7cbf28af3aa..00000000000 --- a/pkg/cmd/config_windows.go +++ /dev/null @@ -1,38 +0,0 @@ -package cmd - -import ( - "fmt" - "strings" - - "golang.org/x/sys/windows/registry" -) - -func (c *Config) windowsVersion() (map[string]any, error) { - registryKey, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) - if err != nil { - return nil, fmt.Errorf("registry.OpenKey: %w", err) - } - windowsVersion := make(map[string]any) - for _, name := range []string{ - "CurrentBuild", - "CurrentVersion", - "DisplayVersion", - "EditionID", - "ProductName", - } { - if value, _, err := registryKey.GetStringValue(name); err == nil { - key := strings.ToLower(name[:1]) + name[1:] - windowsVersion[key] = value - } - } - for _, name := range []string{ - "CurrentMajorVersionNumber", - "CurrentMinorVersionNumber", - } { - if value, _, err := registryKey.GetIntegerValue(name); err == nil { - key := strings.ToLower(name[:1]) + name[1:] - windowsVersion[key] = value - } - } - return windowsVersion, nil -} diff --git a/pkg/cmd/util_unix.go b/pkg/cmd/util_unix.go index 843c5894150..4abc6770393 100644 --- a/pkg/cmd/util_unix.go +++ b/pkg/cmd/util_unix.go @@ -17,3 +17,7 @@ var defaultInterpreters = make(map[string]*chezmoi.Interpreter) func fileInfoUID(info fs.FileInfo) int { return int(info.Sys().(*syscall.Stat_t).Uid) //nolint:forcetypeassert } + +func windowsVersion() (map[string]any, error) { + return nil, nil +} diff --git a/pkg/cmd/util_windows.go b/pkg/cmd/util_windows.go index 8b123a7bde3..d00e7ab7765 100644 --- a/pkg/cmd/util_windows.go +++ b/pkg/cmd/util_windows.go @@ -1,7 +1,11 @@ package cmd import ( + "fmt" "io/fs" + "strings" + + "golang.org/x/sys/windows/registry" "github.com/twpayne/chezmoi/v2/pkg/chezmoi" ) @@ -31,3 +35,33 @@ var defaultInterpreters = map[string]*chezmoi.Interpreter{ func fileInfoUID(fs.FileInfo) int { return 0 } + +func windowsVersion() (map[string]any, error) { + registryKey, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) + if err != nil { + return nil, fmt.Errorf("registry.OpenKey: %w", err) + } + windowsVersion := make(map[string]any) + for _, name := range []string{ + "CurrentBuild", + "CurrentVersion", + "DisplayVersion", + "EditionID", + "ProductName", + } { + if value, _, err := registryKey.GetStringValue(name); err == nil { + key := strings.ToLower(name[:1]) + name[1:] + windowsVersion[key] = value + } + } + for _, name := range []string{ + "CurrentMajorVersionNumber", + "CurrentMinorVersionNumber", + } { + if value, _, err := registryKey.GetIntegerValue(name); err == nil { + key := strings.ToLower(name[:1]) + name[1:] + windowsVersion[key] = value + } + } + return windowsVersion, nil +}
chore
Tidy up OS-specific files
8a6d4d76487267d0c77d7ab06d532f16165d8baf
2021-11-15 01:31:51
Tom Payne
feat: Add .chezmoiroot to allow source state to be subdir of source dir
false
diff --git a/docs/HOWTO.md b/docs/HOWTO.md index 81517220764..bff7dd1783d 100644 --- a/docs/HOWTO.md +++ b/docs/HOWTO.md @@ -54,6 +54,7 @@ * [Run a PowerShell script as admin on Windows](#run-a-powershell-script-as-admin-on-windows) * [Use chezmoi with GitHub Codespaces, Visual Studio Codespaces, or Visual Studio Code Remote - Containers](#use-chezmoi-with-github-codespaces-visual-studio-codespaces-or-visual-studio-code-remote---containers) * [Customize chezmoi](#customize-chezmoi) + * [Use a subdirectory of your dotfiles repo as the root of the source state](#use-a-subdirectory-of-your-dotfiles-repo-as-the-root-of-the-source-state) * [Don't show scripts in the diff output](#dont-show-scripts-in-the-diff-output) * [Customize the diff pager](#customize-the-diff-pager) * [Use a custom diff tool](#use-a-custom-diff-tool) @@ -1602,6 +1603,37 @@ sudo apt install -y vim-gtk --- +### Use a subdirectory of your dotfiles repo as the root of the source state + +By default, chezmoi uses the root of your dotfiles repo as the root of the +source state. If your source state contains many entries in its root, then your +target directory (usually your home directory) will in turn be filled with many +entries in its root as well. You can reduce the number of entries by keeping +`.chezmoiignore` up to date, but this can become tiresome. + +Instead, you can specify that chezmoi should read the source state from a +subdirectory of the source directory instead by creating a file called +`.chezmoiroot` containing the relative path to this subdirectory. + +For example, if `.chezmoiroot` contains: + +``` +home +``` + +Then chezmoi will read the source state from the `home` subdirectory of your +source directory, for example the desired state of `~/.gitconfig` will be read +from `~/.local/share/chezmoi/home/dot_gitconfig` (instead of +`~/.local/share/chezmoi/dot_gitconfig`). + +When migrating an existing chezmoi dotfiles repo to use `.chezmoiroot` you will +need to move the relevant files in to the new root subdirectory manually. You do +not need to move files that are ignored by chezmoi in all cases (i.e. are listed +in `.chezmoiignore` when executed as a template on all machines), and you can +afterwards remove their entries from `home/.chezmoiignore`. + +--- + ### Don't show scripts in the diff output By default, `chezmoi diff` will show all changes, including the contents of diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index 5cc13cc7420..19c8a8abe1a 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -50,6 +50,7 @@ Manage your dotfiles across multiple machines, securely. * [`.chezmoiexternal.<format>`](#chezmoiexternalformat) * [`.chezmoiignore`](#chezmoiignore) * [`.chezmoiremove`](#chezmoiremove) + * [`.chezmoiroot`](#chezmoiroot) * [`.chezmoitemplates`](#chezmoitemplates) * [`.chezmoiversion`](#chezmoiversion) * [Commands](#commands) @@ -875,6 +876,15 @@ template. --- +### `.chezmoiroot` + +If a file called `.chezmoiroot` exists in the root of the source directory then +the source state is read from the directory specified in `.chezmoiroot` +interpreted as a relative path to the source directory. `.chezmoiroot` is read +before all other files in the source directory. + +--- + ### `.chezmoitemplates` If a directory called `.chezmoitemplates` exists, then all files in this diff --git a/internal/chezmoi/chezmoi.go b/internal/chezmoi/chezmoi.go index 7efaf5af5a4..4a2aac0d70e 100644 --- a/internal/chezmoi/chezmoi.go +++ b/internal/chezmoi/chezmoi.go @@ -50,6 +50,7 @@ const ( const ( Prefix = ".chezmoi" + RootName = Prefix + "root" dataName = Prefix + "data" externalName = Prefix + "external" ignoreName = Prefix + "ignore" @@ -69,6 +70,7 @@ var knownPrefixedFiles = newStringSet( Prefix+".json"+TemplateSuffix, Prefix+".toml"+TemplateSuffix, Prefix+".yaml"+TemplateSuffix, + RootName, dataName, externalName+".json", externalName+".toml", diff --git a/internal/cmd/config.go b/internal/cmd/config.go index b60d618c413..51ba2bc2acf 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -1285,6 +1285,16 @@ func (c *Config) newRootCmd() (*cobra.Command, error) { // newSourceState returns a new SourceState with options. func (c *Config) newSourceState(ctx context.Context, options ...chezmoi.SourceStateOption) (*chezmoi.SourceState, error) { sourceStateLogger := c.logger.With().Str(logComponentKey, logComponentValueSourceState).Logger() + + sourceDirAbsPath := c.SourceDirAbsPath + switch data, err := c.sourceSystem.ReadFile(c.SourceDirAbsPath.JoinString(chezmoi.RootName)); { + case errors.Is(err, fs.ErrNotExist): + case err != nil: + return nil, err + default: + sourceDirAbsPath = c.SourceDirAbsPath.JoinString(string(bytes.TrimSpace(data))) + } + s := chezmoi.NewSourceState(append([]chezmoi.SourceStateOption{ chezmoi.WithBaseSystem(c.baseSystem), chezmoi.WithCacheDir(c.CacheDirAbsPath), @@ -1295,7 +1305,7 @@ func (c *Config) newSourceState(ctx context.Context, options ...chezmoi.SourceSt chezmoi.WithLogger(&sourceStateLogger), chezmoi.WithMode(c.Mode), chezmoi.WithPriorityTemplateData(c.Data), - chezmoi.WithSourceDir(c.SourceDirAbsPath), + chezmoi.WithSourceDir(sourceDirAbsPath), chezmoi.WithSystem(c.sourceSystem), chezmoi.WithTemplateFuncs(c.templateFuncs), chezmoi.WithTemplateOptions(c.Template.Options), diff --git a/internal/cmd/testdata/scripts/root.txt b/internal/cmd/testdata/scripts/root.txt new file mode 100644 index 00000000000..0d19968de5e --- /dev/null +++ b/internal/cmd/testdata/scripts/root.txt @@ -0,0 +1,36 @@ +# test that chezmoi apply uses .chezmoiroot +chezmoi apply +cmp $HOME/.file golden/.file + +# test that chezmoi add uses .chezmoiroot +symlink $HOME/.symlink -> .file +chezmoi add $HOME${/}.symlink +cmp $CHEZMOISOURCEDIR/home/symlink_dot_symlink golden/symlink_dot_symlink + +[!exec:git] skip 'git not found in $PATH' +[windows] skip 'go-git does not support file:// URLs on windows' + +chhome home2/user +mkgitconfig + +# create a git repo in home2/user/repo +exec git -C $HOME/repo init +exec git -C $HOME/repo add . +exec git -C $HOME/repo commit -m 'Initial commit' + +# test that chezmoi init uses .chezmoiroot +chezmoi init --apply file://$HOME/repo +cmp $HOME/.file golden/.file + +-- golden/.file -- +# contents of .file +-- golden/symlink_dot_symlink -- +.file +-- home/user/.local/share/chezmoi/.chezmoiroot -- +home +-- home/user/.local/share/chezmoi/home/dot_file -- +# contents of .file +-- home2/user/repo/.chezmoiroot -- +home +-- home2/user/repo/home/dot_file -- +# contents of .file
feat
Add .chezmoiroot to allow source state to be subdir of source dir
d30c50c68e1dcf1fab905dbf39feba0e04bde2f8
2022-10-25 04:28:51
Tom Payne
fix: Include git repo external state in state dump output
false
diff --git a/pkg/chezmoi/persistentstate.go b/pkg/chezmoi/persistentstate.go index 19ae7e4e0de..3fc73c9da7e 100644 --- a/pkg/chezmoi/persistentstate.go +++ b/pkg/chezmoi/persistentstate.go @@ -7,14 +7,14 @@ var ( // EntryStateBucket is the bucket for recording the entry states. EntryStateBucket = []byte("entryState") + // gitRepoExternalState is the bucket for recording the state of commands + // that modify directories. + gitRepoExternalState = []byte("gitRepoExternalState") + // scriptStateBucket is the bucket for recording the state of run once // scripts. scriptStateBucket = []byte("scriptState") - // modifyDirWithCmdStateBucket is the bucket for recording the state of - // commands that modify directories. - modifyDirWithCmdStateBucket = []byte("gitRepoExternalState") - stateFormat = formatJSON{} ) @@ -56,18 +56,24 @@ func PersistentStateData(s PersistentState) (any, error) { if err != nil { return nil, err } + gitRepoExternalData, err := PersistentStateBucketData(s, gitRepoExternalState) + if err != nil { + return nil, err + } scriptStateData, err := PersistentStateBucketData(s, scriptStateBucket) if err != nil { return nil, err } return struct { - ConfigState any `json:"configState" yaml:"configState"` - EntryState any `json:"entryState" yaml:"entryState"` - ScriptState any `json:"scriptState" yaml:"scriptState"` + ConfigState any `json:"configState" yaml:"configState"` + EntryState any `json:"entryState" yaml:"entryState"` + GitRepoExternalData any `json:"gitRepoExternalState" yaml:"gitRepoExternalState"` + ScriptState any `json:"scriptState" yaml:"scriptState"` }{ - ConfigState: configStateData, - EntryState: entryStateData, - ScriptState: scriptStateData, + ConfigState: configStateData, + EntryState: entryStateData, + GitRepoExternalData: gitRepoExternalData, + ScriptState: scriptStateData, }, nil } diff --git a/pkg/chezmoi/targetstateentry.go b/pkg/chezmoi/targetstateentry.go index 088cfaac27a..df2c194de4a 100644 --- a/pkg/chezmoi/targetstateentry.go +++ b/pkg/chezmoi/targetstateentry.go @@ -90,7 +90,7 @@ func (t *TargetStateModifyDirWithCmd) Apply( modifyDirWithCmdStateKey := []byte(actualStateEntry.Path().String()) if err := persistentStateSet( - persistentState, modifyDirWithCmdStateBucket, modifyDirWithCmdStateKey, &modifyDirWithCmdState{ + persistentState, gitRepoExternalState, modifyDirWithCmdStateKey, &modifyDirWithCmdState{ Name: actualStateEntry.Path(), RunAt: runAt, }); err != nil { @@ -119,7 +119,7 @@ func (t *TargetStateModifyDirWithCmd) SkipApply(persistentState PersistentState, return false, nil } modifyDirWithCmdKey := []byte(targetAbsPath.String()) - switch modifyDirWithCmdStateBytes, err := persistentState.Get(modifyDirWithCmdStateBucket, modifyDirWithCmdKey); { + switch modifyDirWithCmdStateBytes, err := persistentState.Get(gitRepoExternalState, modifyDirWithCmdKey); { case err != nil: return false, err case modifyDirWithCmdStateBytes == nil: diff --git a/pkg/cmd/testdata/scripts/configstate.txtar b/pkg/cmd/testdata/scripts/configstate.txtar index cd2fc766e38..9b7648c2d71 100644 --- a/pkg/cmd/testdata/scripts/configstate.txtar +++ b/pkg/cmd/testdata/scripts/configstate.txtar @@ -67,6 +67,7 @@ configState: configState: configTemplateContentsSHA256: af43121a524340707b84e390f510c949731177e6f2a25b3b6b11b2fc656cf8f2 entryState: {} +gitRepoExternalState: {} scriptState: {} -- home/user/.local/share/chezmoi/.chezmoi.toml.tmpl -- [data] diff --git a/pkg/cmd/testdata/scripts/state_unix.txtar b/pkg/cmd/testdata/scripts/state_unix.txtar index 1df1c0df28c..5ade90e546f 100644 --- a/pkg/cmd/testdata/scripts/state_unix.txtar +++ b/pkg/cmd/testdata/scripts/state_unix.txtar @@ -40,6 +40,7 @@ stdout runAt: -- golden/dump.yaml -- configState: {} entryState: {} +gitRepoExternalState: {} scriptState: {} -- home/user/.local/share/chezmoi/run_once_script.sh -- #!/bin/sh diff --git a/pkg/cmd/testdata/scripts/state_windows.txtar b/pkg/cmd/testdata/scripts/state_windows.txtar index c752456bb00..c2ac353d848 100644 --- a/pkg/cmd/testdata/scripts/state_windows.txtar +++ b/pkg/cmd/testdata/scripts/state_windows.txtar @@ -21,6 +21,7 @@ exec chezmoi --force state reset -- golden/dump.yaml -- configState: {} entryState: {} +gitRepoExternalState: {} scriptState: {} -- home/user/.local/share/chezmoi/run_once_script.cmd -- :: don't need to actually do anything
fix
Include git repo external state in state dump output
02abd9a4e21bedb5e583825841496e6949d49b43
2021-10-06 04:24:53
Piotr Suwara
fix: Allow create_ entries to be templates
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 15fc1e64b87..23efb5fde56 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -1184,21 +1184,32 @@ func (s *SourceState) newSourceStateDir(sourceRelPath SourceRelPath, dirAttr Dir // newCreateTargetStateEntryFunc returns a targetStateEntryFunc that returns a // 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(fileAttr FileAttr, sourceLazyContents *lazyContents) targetStateEntryFunc { +func (s *SourceState) newCreateTargetStateEntryFunc(sourceRelPath SourceRelPath, fileAttr FileAttr, sourceLazyContents *lazyContents) targetStateEntryFunc { return func(destSystem System, destAbsPath AbsPath) (TargetStateEntry, error) { + var lazyContents *lazyContents contents, err := destSystem.ReadFile(destAbsPath) switch { case err == nil: + lazyContents = newLazyContents(contents) case errors.Is(err, fs.ErrNotExist): - contents, err = sourceLazyContents.Contents() - if err != nil { - return nil, err - } + lazyContents = newLazyContentsFunc(func() ([]byte, error) { + contents, err = sourceLazyContents.Contents() + if err != nil { + return nil, err + } + if fileAttr.Template { + contents, err = s.ExecuteTemplateData(sourceRelPath.String(), contents) + if err != nil { + return nil, err + } + } + return contents, nil + }) default: return nil, err } return &TargetStateFile{ - lazyContents: newLazyContents(contents), + lazyContents: lazyContents, empty: true, perm: fileAttr.perm() &^ s.umask, }, nil @@ -1386,7 +1397,7 @@ func (s *SourceState) newSourceStateFile(sourceRelPath SourceRelPath, fileAttr F var targetStateEntryFunc targetStateEntryFunc switch fileAttr.Type { case SourceFileTypeCreate: - targetStateEntryFunc = s.newCreateTargetStateEntryFunc(fileAttr, sourceLazyContents) + targetStateEntryFunc = s.newCreateTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents) case SourceFileTypeFile: targetStateEntryFunc = s.newFileTargetStateEntryFunc(sourceRelPath, fileAttr, sourceLazyContents) case SourceFileTypeModify: diff --git a/internal/cmd/testdata/scripts/create.txt b/internal/cmd/testdata/scripts/create.txt new file mode 100644 index 00000000000..29d3b693ff3 --- /dev/null +++ b/internal/cmd/testdata/scripts/create.txt @@ -0,0 +1,43 @@ +# test that chezmoi apply creates a file from a template +mkdir $CHEZMOISOURCEDIR +cp golden/create_dot_create.tmpl $CHEZMOISOURCEDIR +chezmoi apply --force +cmp $HOME/.create golden/.create + +[windows] skip 'UNIX only' +[!exec:age] skip 'age not found in $PATH' + +chhome home2/user + +# test that chezmoi apply creates encrypted create_ targets +mkageconfig +mkdir $CHEZMOISOURCEDIR +chezmoi encrypt --output=$CHEZMOISOURCEDIR/create_encrypted_dot_create.age golden/.create +grep '-----BEGIN AGE ENCRYPTED FILE-----' $CHEZMOISOURCEDIR/create_encrypted_dot_create.age +chezmoi apply --force +cmp $HOME/.create golden/.create + +chhome home3/user + +# test that chezmoi apply creates encrypted template create_ targets +mkageconfig +mkdir $CHEZMOISOURCEDIR +chezmoi encrypt --output=$CHEZMOISOURCEDIR/create_encrypted_dot_create.tmpl.age golden/create_dot_create.tmpl +grep '-----BEGIN AGE ENCRYPTED FILE-----' $CHEZMOISOURCEDIR/create_encrypted_dot_create.tmpl.age +chezmoi apply --force +cmp $HOME/.create golden/.create + +chhome home4/user + +# test that chezmoi manage does not execute template create_ targets +chezmoi managed +cmp stdout golden/managed + +-- golden/.create -- +# contents of .create +-- golden/create_dot_create.tmpl -- +{{ "# contents of .create" }} +-- golden/managed -- +.create +-- home4/user/.local/share/chezmoi/create_dot_create.tmpl -- +{{ fail "Template should not be executed }} diff --git a/internal/cmd/testdata/scripts/createencrypted.txt b/internal/cmd/testdata/scripts/createencrypted.txt deleted file mode 100644 index 295bd861549..00000000000 --- a/internal/cmd/testdata/scripts/createencrypted.txt +++ /dev/null @@ -1,14 +0,0 @@ -[windows] skip 'UNIX only' -[!exec:age] skip 'age not found in $PATH' - -mkageconfig - -# test that chezmoi applies encrypted create_ targets -mkdir $CHEZMOISOURCEDIR -chezmoi encrypt --output=$CHEZMOISOURCEDIR/create_encrypted_dot_create.age golden/.create -grep '-----BEGIN AGE ENCRYPTED FILE-----' $CHEZMOISOURCEDIR/create_encrypted_dot_create.age -chezmoi apply --force -cmp $HOME/.create golden/.create - --- golden/.create -- -# contents of .create
fix
Allow create_ entries to be templates
8565539d398d32a804566e540b412b5736ad65e6
2025-02-15 01:33:37
Tom Payne
chore: Update tools
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e71b9c8e1f8..504e9a4316d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,13 +21,13 @@ env: FIND_TYPOS_VERSION: 0.0.3 # https://github.com/twpayne/find-typos/tags GO_VERSION: 1.24.0 # https://go.dev/doc/devel/release GOFUMPT_VERSION: 0.7.0 # https://github.com/mvdan/gofumpt/releases - GOLANGCI_LINT_VERSION: 1.64.4 # https://github.com/golangci/golangci-lint/releases + GOLANGCI_LINT_VERSION: 1.64.5 # https://github.com/golangci/golangci-lint/releases GOLINES_VERSION: 0.12.2 # https://github.com/segmentio/golines/releases GORELEASER_VERSION: 2.7.0 # https://github.com/goreleaser/goreleaser/releases 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.5.31 # https://github.com/astral-sh/uv/releases + UV_VERSION: 0.6.0 # https://github.com/astral-sh/uv/releases jobs: changes: runs-on: ubuntu-22.04 @@ -456,7 +456,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} upload-cache: false - - uses: golangci/golangci-lint-action@e0ebdd245eea59746bb0b28ea6a9871d3e35fbc9 + - uses: golangci/golangci-lint-action@818ec4d51a1feacefc42ff1b3ec25d4962690f39 with: version: v${{ env.GOLANGCI_LINT_VERSION }} args: --timeout=5m
chore
Update tools
84c5790e5f96a425cdbe8e7e079a699a5db89efc
2025-02-18 19:36:49
Tom Payne
chore: Update tools
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03576d60fc0..dee91db3b90 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.0 # https://github.com/astral-sh/uv/releases + UV_VERSION: 0.6.1 # https://github.com/astral-sh/uv/releases jobs: changes: runs-on: ubuntu-22.04
chore
Update tools
1c0a626fe9386f891424db9a3f167aa6730ca127
2022-05-01 05:05:33
Tom Payne
chore: Documentation tweaks
false
diff --git a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md index 59e955f6b1b..0280bb270d3 100644 --- a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md +++ b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/design.md @@ -19,7 +19,7 @@ merge-all` will help you resolve any differences. * If the dotfile is encrypted in the source state, then `chezmoi edit` will decrypt it to a private directory, open that file in your `$EDITOR`, and then - re-encrypt the file when you quit your editor. That makes encryption + re-encrypt the file when you quit your editor. This makes encryption transparent. * With the `--diff` and `--apply` options you can see what would change and @@ -35,9 +35,9 @@ you syntax highlighting, however you edit your files. ## Why doesn't chezmoi use symlinks like GNU Stow? Symlinks are first class citizens in chezmoi: chezmoi supports creating them, -updating them, removing them, and even more advanced features not found -elsewhere like having the same symlink point to different targets on different -machines by using a template. +updating them, removing them, and even more advanced features not found in other +dotfile managers like having the same symlink point to different targets on +different machines by using a template. With chezmoi, you only use a symlink where you really need a symlink, in contrast to some other dotfile managers (e.g. GNU Stow) which require the use @@ -52,9 +52,9 @@ final location from the contents of the centralized directory. This approach allows chezmoi to provide features that are not possible when using symlinks, for example having files that are encrypted, executable, private, or templates. -There is nothing special about dotfiles managed by chezmoi, whereas dotfiles -managed with GNU Stow are special because they're actually symlinks to -somewhere else. +There is nothing special about dotfiles managed by chezmoi whereas dotfiles +managed with GNU Stow are special because they're actually symlinks to somewhere +else. The only advantage to using GNU Stow-style symlinks is that changes that you make to the dotfile's contents in the centralized directory are immediately @@ -63,10 +63,8 @@ visible, whereas chezmoi currently requires you to run `chezmoi apply` or too, see [#752](https://github.com/twpayne/chezmoi/issues/752). If you really want to use symlinks, then chezmoi provides a [symlink -mode](/reference/target-types/#symlink-mode) which uses symlinks where -possible. - -You can configure chezmoi to work like GNU Stow and have it create a set of +mode](/reference/target-types/#symlink-mode) which uses symlinks where possible. +This configures chezmoi to work like GNU Stow and have it create a set of symlinks back to a central directory, but this currently requires a bit of manual work (as described in [#167](https://github.com/twpayne/chezmoi/issues/167)). chezmoi might get some @@ -116,7 +114,7 @@ chezmoi's decision to store metadata in filenames is a deliberate, practical, compromise. Firstly, almost all programs store metadata in filenames: the filename's -extension. chezmoi extends this to storing metadata in attributes in the +extension. chezmoi extends the filename to storing metadata in attributes in the filename's prefix as well. The `dot_` attribute makes it transparent which dotfiles are managed by chezmoi
chore
Documentation tweaks
fe6010e8b2518ddabfcd5f58236763b4f2e90ff8
2023-04-22 01:13:06
Tom Payne
fix: Correct capitalization of .chezmoi.config template variables
false
diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index af22f75115c..6581ae7299c 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -237,7 +237,7 @@ type templateData struct { args []string cacheDir chezmoi.AbsPath command string - config ConfigFile + config map[string]any configFile chezmoi.AbsPath executable chezmoi.AbsPath fqdnHostname string @@ -2084,7 +2084,7 @@ func (c *Config) newTemplateData(cmd *cobra.Command) *templateData { args: os.Args, cacheDir: c.CacheDirAbsPath, command: cmd.Name(), - config: c.ConfigFile, + config: c.ConfigFile.toMap(), configFile: c.configFileAbsPath, executable: chezmoi.NewAbsPath(executable), fqdnHostname: fqdnHostname, @@ -2533,6 +2533,14 @@ func newConfigFile(bds *xdg.BaseDirectorySpecification) ConfigFile { } } +func (f *ConfigFile) toMap() map[string]any { + var result map[string]any + if err := mapstructure.Decode(f, &result); err != nil { + panic(err) + } + return result +} + func parseCommand(command string, args []string) (string, []string, error) { // If command is found, then return it. if path, err := chezmoi.LookPath(command); err == nil { diff --git a/pkg/cmd/testdata/scripts/issue2942.txtar b/pkg/cmd/testdata/scripts/issue2942.txtar new file mode 100644 index 00000000000..80689ef81e3 --- /dev/null +++ b/pkg/cmd/testdata/scripts/issue2942.txtar @@ -0,0 +1,3 @@ +# test that .chezmoi.config variables are capitalized correctly +exec chezmoi execute-template '{{ .chezmoi.config.keepassxc.command }}' +stdout '^keepassxc-cli$'
fix
Correct capitalization of .chezmoi.config template variables
eb551b7131f8470522ccfef9dc5df7c893faaeb6
2023-01-28 21:10:53
Tom Payne
feat: Use high-performance github.com/klauspost/compress library
false
diff --git a/.golangci.yml b/.golangci.yml index 866fd39f1db..3f93715be40 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -96,6 +96,8 @@ linters: linters-settings: forbidigo: forbid: + - ^archive/zip\. + - ^compress/gzip\. - ^fmt\.Print.*$ - ^ioutil\..*$ - ^os\.(DirEntry|FileInfo|FileMode|Is.*|Mode.*)$ diff --git a/pkg/archivetest/zip.go b/pkg/archivetest/zip.go index 6257fbd0469..de8c85bddab 100644 --- a/pkg/archivetest/zip.go +++ b/pkg/archivetest/zip.go @@ -1,10 +1,11 @@ package archivetest import ( - "archive/zip" "bytes" "fmt" "io/fs" + + "github.com/klauspost/compress/zip" ) func NewZip(root map[string]any) ([]byte, error) { diff --git a/pkg/archivetest/zip_test.go b/pkg/archivetest/zip_test.go index df3b0629a28..7dea31535a8 100644 --- a/pkg/archivetest/zip_test.go +++ b/pkg/archivetest/zip_test.go @@ -1,11 +1,11 @@ package archivetest import ( - "archive/zip" "bytes" "io/fs" "testing" + "github.com/klauspost/compress/zip" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/chezmoi/archive.go b/pkg/chezmoi/archive.go index df79e88e39c..fec2ec395c3 100644 --- a/pkg/chezmoi/archive.go +++ b/pkg/chezmoi/archive.go @@ -2,10 +2,8 @@ package chezmoi import ( "archive/tar" - "archive/zip" "bytes" "compress/bzip2" - "compress/gzip" "errors" "fmt" "io" @@ -14,6 +12,8 @@ import ( "strings" "time" + "github.com/klauspost/compress/gzip" + "github.com/klauspost/compress/zip" "github.com/klauspost/compress/zstd" "github.com/ulikunitz/xz" ) diff --git a/pkg/chezmoi/zipwritersystem.go b/pkg/chezmoi/zipwritersystem.go index 139b9fecc06..609952781ad 100644 --- a/pkg/chezmoi/zipwritersystem.go +++ b/pkg/chezmoi/zipwritersystem.go @@ -1,11 +1,12 @@ package chezmoi import ( - "archive/zip" "io" "io/fs" "os/exec" "time" + + "github.com/klauspost/compress/zip" ) // A ZIPWriterSystem is a System that writes to a ZIP archive. diff --git a/pkg/chezmoi/zipwritersystem_test.go b/pkg/chezmoi/zipwritersystem_test.go index 83e8ab5d199..26731788d3d 100644 --- a/pkg/chezmoi/zipwritersystem_test.go +++ b/pkg/chezmoi/zipwritersystem_test.go @@ -1,7 +1,6 @@ package chezmoi import ( - "archive/zip" "bytes" "context" "io" @@ -10,6 +9,7 @@ import ( "time" "github.com/coreos/go-semver/semver" + "github.com/klauspost/compress/zip" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" vfs "github.com/twpayne/go-vfs/v4" diff --git a/pkg/cmd/archivecmd.go b/pkg/cmd/archivecmd.go index a57d0f6778d..4ba7748ac0d 100644 --- a/pkg/cmd/archivecmd.go +++ b/pkg/cmd/archivecmd.go @@ -2,12 +2,12 @@ package cmd import ( "archive/tar" - "compress/gzip" "os/user" "strconv" "strings" "time" + "github.com/klauspost/compress/gzip" "github.com/spf13/cobra" "github.com/twpayne/chezmoi/v2/pkg/chezmoi"
feat
Use high-performance github.com/klauspost/compress library
fd0d5f13d1b11e1e24eee2154ee40a9b751cf847
2022-05-01 15:33:54
dependabot[bot]
chore(deps): bump actions/cache from 3.0.1 to 3.0.2
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 399d4513a5e..833b9446136 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: VAGRANT_BOX: debian11-i386 steps: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/.vagrant.d key: ${{ runner.os }}-vagrant-${{ env.VAGRANT_BOX }}-${{ @@ -117,7 +117,7 @@ jobs: VAGRANT_BOX: freebsd13 steps: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/.vagrant.d key: ${{ runner.os }}-vagrant-${{ env.VAGRANT_BOX }}-${{ @@ -136,7 +136,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -171,7 +171,7 @@ jobs: VAGRANT_BOX: openbsd7 steps: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/.vagrant.d key: ${{ runner.os }}-vagrant-${{ env.VAGRANT_BOX }}-${{ @@ -198,7 +198,7 @@ jobs: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 with: fetch-depth: 0 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -287,7 +287,7 @@ jobs: with: go-version: 1.17.x - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-ubuntu-go-1-17-${{ hashFiles('**/go.sum') }} @@ -319,7 +319,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -369,7 +369,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -431,7 +431,7 @@ jobs: - uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # pin@v3 with: fetch-depth: 0 - - uses: actions/cache@136d96b4aee02b1f0de3ba493b1d47135042d9c0 # [email protected] + - uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # [email protected] with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
chore
bump actions/cache from 3.0.1 to 3.0.2
eb0d6231e74be92eed794e441a1e3bcf290ff804
2023-06-02 17:44:15
dependabot[bot]
chore(deps): bump sigstore/cosign-installer from 3.0.3 to 3.0.5
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0de996d365c..d605979c4db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -403,7 +403,7 @@ jobs: - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} - - uses: sigstore/cosign-installer@204a51a57a74d190b284a0ce69b44bc37201f343 + - uses: sigstore/cosign-installer@dd6b2e2b610a11fd73dd187a43d57cc1394e35f9 - name: create-syso run: | make create-syso
chore
bump sigstore/cosign-installer from 3.0.3 to 3.0.5
a89e0e0886d2ee1ef6c606a4f2dea4bb8f743a88
2023-08-31 00:57:17
Tom Payne
docs: Tweak location of private key in age onetime passphrase how-to
false
diff --git a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/encryption.md b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/encryption.md index c6bac1fba39..abca106a402 100644 --- a/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/encryption.md +++ b/assets/chezmoi.io/docs/user-guide/frequently-asked-questions/encryption.md @@ -43,8 +43,9 @@ Configure chezmoi to decrypt the passphrase-encrypted private key if needed: $ cat > run_once_before_decrypt-private-key.sh.tmpl <<EOF #!/bin/sh -if [ ! -f "${HOME}/key.txt" ]; then - chezmoi age decrypt --output "${HOME}/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age" +if [ ! -f "${HOME}/.config/chezmoi/key.txt" ]; then + mkdir -p "${HOME}/.config/chezmoi" + chezmoi age decrypt --output "${HOME}/.config/chezmoi/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age" chmod 600 "${HOME}/key.txt" fi EOF @@ -56,7 +57,7 @@ Configure chezmoi to use the public and private key for encryption: $ cat >> .chezmoi.toml.tmpl <<EOF encryption = "age" [age] - identity = "~/key.txt" + identity = "~/.config/chezmoi/key.txt" recipient = "age193wd0hfuhtjfsunlq3c83s8m93pde442dkcn7lmj3lspeekm9g7stwutrl" EOF ``` @@ -98,4 +99,4 @@ $ chezmoi add --encrypt ~/.ssh/id_rsa When you run `chezmoi init` on a new machine you will be prompted to enter your passphrase once to decrypt `key.txt.age`. Your decrypted private key will be -stored in `~/key.txt`. +stored in `~/.config/chezmoi/key.txt`.
docs
Tweak location of private key in age onetime passphrase how-to
e6b0a68592a79fce8fc61456eb627ee3f5c89ee9
2022-10-31 15:28:41
Tom Payne
chore: Fix release installation of goversioninfo
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94c40a6aa58..25ec562e5b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -201,9 +201,9 @@ jobs: run: | sudo apt-get --quiet update sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft - go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v${{ env.GOVERSIONINFO_VERSION }} - go run ./internal/cmds/execute-template -output ./versioninfo.json ./assets/templates/versioninfo.json.tmpl - goversioninfo -platform-specific + - name: create-syso + run: | + make create-syso - name: build-release if: github.event_name == 'push' || needs.changes.outputs.code == 'true' uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 @@ -400,9 +400,6 @@ jobs: sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft sudo snap install --classic snapcraft sudo apt-get --quiet remove snapcraft - go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v${{ env.GOVERSIONINFO_VERSION }} - go run ./internal/cmds/execute-template -output ./versioninfo.json ./assets/templates/versioninfo.json.tmpl - goversioninfo -platform-specific - name: check-snapcraft-credentials run: snapcraft whoami env: @@ -415,6 +412,9 @@ jobs: cache: true go-version: ${{ env.GO_VERSION }} - uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b + - name: create-syso + run: | + make create-syso - uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 with: version: latest diff --git a/Makefile b/Makefile index 6df910d3d66..0ef59e0ea2d 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ format: ensure-gofumpt format-yaml: find . -name \*.yaml -o -name \*.yml | xargs ./assets/scripts/format-yaml.py -.PHONY: create-syso ensure-goversioninfo +.PHONY: create-syso create-syso: ensure-goversioninfo ${GO} run ./internal/cmds/execute-template -output ./versioninfo.json ./assets/templates/versioninfo.json.tmpl ./bin/goversioninfo -platform-specific
chore
Fix release installation of goversioninfo
52e7c82feda248f9cc341a6332f3bde276b0eba9
2022-10-30 18:35:58
Braden Hilton
chore: Reorder eqFold template function reference page
false
diff --git a/assets/chezmoi.io/mkdocs.yml b/assets/chezmoi.io/mkdocs.yml index e169fcfa21f..14b7a9c4125 100644 --- a/assets/chezmoi.io/mkdocs.yml +++ b/assets/chezmoi.io/mkdocs.yml @@ -174,6 +174,7 @@ nav: - comment: reference/templates/functions/comment.md - decrypt: reference/templates/functions/decrypt.md - encrypt: reference/templates/functions/encrypt.md + - eqFold: reference/templates/functions/eqFold.md - fromIni: reference/templates/functions/fromIni.md - fromToml: reference/templates/functions/fromToml.md - fromYaml: reference/templates/functions/fromYaml.md @@ -188,7 +189,6 @@ nav: - quoteList: reference/templates/functions/quoteList.md - replaceAllRegex: reference/templates/functions/replaceAllRegex.md - stat: reference/templates/functions/stat.md - - eqFold: reference/templates/functions/eqFold.md - toIni: reference/templates/functions/toIni.md - toToml: reference/templates/functions/toToml.md - toYaml: reference/templates/functions/toYaml.md
chore
Reorder eqFold template function reference page
9c273ebf76f8d7bc6be06d61210e43fdd11fbd4e
2024-01-21 22:02:18
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 87e563918f4..8e232473c7a 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.19 require ( filippo.io/age v1.1.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.0.1 github.com/Masterminds/sprig/v3 v3.2.3 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/alecthomas/assert/v2 v2.5.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/config v1.26.5 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 @@ -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-20240112132812-db7319d0e0e3 + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/oauth2 v0.16.0 golang.org/x/sync v0.6.0 golang.org/x/sys v0.16.0 @@ -68,20 +68,20 @@ require ( 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 - github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect + github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/alecthomas/chroma v0.10.0 // indirect 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.14 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // 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.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/sso v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // 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 diff --git a/go.sum b/go.sum index c951e2cb45f..c2964038550 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.0.1 h1:8TkzQBrN9PWIwo7ekdd696KpC6IfTltV2/F8qKKBWik= @@ -42,12 +42,12 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c h1:kMFnB0vCcX7IL/m9Y5LO+KQYv+t1CQOiFe6+SV2J7bE= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= +github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/Shopify/ejson v1.4.1 h1:zGGojGJNTdIWza/kOT8gd2HKCg3ZkSi3CZ1ZX70NHsw= github.com/Shopify/ejson v1.4.1/go.mod h1:VZMUtDzvBW/PAXRUF5fzp1ffb1ucT8MztrZXXLYZurw= -github.com/alecthomas/assert/v2 v2.4.1 h1:mwPZod/d35nlaCppr6sFP0rbCL05WH9fIo7lvsf47zo= -github.com/alecthomas/assert/v2 v2.4.1/go.mod h1:fw5suVxB+wfYJ3291t0hRTqtGzFYdSwstnRQdaQx2DM= +github.com/alecthomas/assert/v2 v2.5.0 h1:OJKYg53BQx06/bMRBSPDCO49CbCDNiUQXwdoNrt6x5w= +github.com/alecthomas/assert/v2 v2.5.0/go.mod h1:fw5suVxB+wfYJ3291t0hRTqtGzFYdSwstnRQdaQx2DM= github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= github.com/alecthomas/repr v0.3.0 h1:NeYzUPfjjlqHY4KtzgKJiWd6sVq2eNUPTi34PiFGjY8= @@ -64,10 +64,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.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.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.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/config v1.26.5 h1:lodGSevz7d+kkFJodfauThRxK9mdJbyutUxGq1NNhvw= +github.com/aws/aws-sdk-go-v2/config v1.26.5/go.mod h1:DxHrz6diQJOc9EwDslVRh84VjjrE17g+pVZXUeSxaDU= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0= 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.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4= @@ -82,10 +82,10 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIG 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.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= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8= 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= @@ -482,8 +482,8 @@ 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-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= -golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/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=
chore
Update dependencies
a5ea6ca2e461f379b05f8086d777d3ed703783cb
2024-12-01 15:25:24
dependabot[bot]
chore(deps): bump the actions group with 2 updates
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00c2b33a97b..624e09110a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,10 +70,10 @@ jobs: with: go-version: ${{ env.GO_VERSION }} upload-cache: false - - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd + - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 with: languages: go - - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd + - uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 misspell: runs-on: ubuntu-22.04 permissions: @@ -330,7 +330,7 @@ jobs: with: cache-prefix: website-go go-version: ${{ env.GO_VERSION }} - - uses: astral-sh/setup-uv@5f42d5af6c403a722299fda36d451c39f302a433 + - uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a with: enable-cache: true version: ${{ env.UV_VERSION }} @@ -513,7 +513,7 @@ jobs: with: cache-prefix: website-go go-version: ${{ env.GO_VERSION }} - - uses: astral-sh/setup-uv@5f42d5af6c403a722299fda36d451c39f302a433 + - uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a with: enable-cache: true version: ${{ env.UV_VERSION }}
chore
bump the actions group with 2 updates
e7238cbf2851949a384fecb2517817bce91ad37a
2021-01-28 23:40:30
Tom Payne
docs: Add link to blog post
false
diff --git a/chezmoi2/cmd/docs.gen.go b/chezmoi2/cmd/docs.gen.go index 2dfc74a0acc..dce0474ff86 100644 --- a/chezmoi2/cmd/docs.gen.go +++ b/chezmoi2/cmd/docs.gen.go @@ -1821,25 +1821,26 @@ func init() { "\n" + "Recommended podcast: [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556)\n" + "\n" + - "| Date | Version | Format | Link |\n" + - "| ---------- | ------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n" + - "| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) |\n" + - "| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) |\n" + - "| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) |\n" + - "| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) |\n" + - "| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) |\n" + - "| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) |\n" + - "| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) |\n" + - "| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) |\n" + - "| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) |\n" + - "| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) |\n" + - "| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) |\n" + - "| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) |\n" + - "| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) |\n" + - "| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) |\n" + - "| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) |\n" + - "| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) |\n" + - "| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) |\n" + + "| Date | Version | Format | Link |\n" + + "| ---------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n" + + "| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) |\n" + + "| 2021-01-12 | 1.8.10 | Text | [Automating the Setup of a New Mac With All Your Apps, Preferences, and Development Tools](https://www.moncefbelyamani.com/automating-the-setup-of-a-new-mac-with-all-your-apps-preferences-and-development-tools/) |\n" + + "| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) |\n" + + "| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) |\n" + + "| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) |\n" + + "| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) |\n" + + "| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) |\n" + + "| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) |\n" + + "| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) |\n" + + "| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) |\n" + + "| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) |\n" + + "| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) |\n" + + "| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) |\n" + + "| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) |\n" + + "| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) |\n" + + "| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) |\n" + + "| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) |\n" + + "| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) |\n" + "\n" + "To add your article to this page please either [open an\n" + "issue](https://github.com/twpayne/chezmoi/issues/new/choose) or submit a pull\n" + diff --git a/cmd/docs.gen.go b/cmd/docs.gen.go index 67c10e44573..49088c33013 100644 --- a/cmd/docs.gen.go +++ b/cmd/docs.gen.go @@ -1821,25 +1821,26 @@ func init() { "\n" + "Recommended podcast: [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556)\n" + "\n" + - "| Date | Version | Format | Link |\n" + - "| ---------- | ------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n" + - "| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) |\n" + - "| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) |\n" + - "| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) |\n" + - "| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) |\n" + - "| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) |\n" + - "| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) |\n" + - "| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) |\n" + - "| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) |\n" + - "| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) |\n" + - "| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) |\n" + - "| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) |\n" + - "| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) |\n" + - "| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) |\n" + - "| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) |\n" + - "| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) |\n" + - "| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) |\n" + - "| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) |\n" + + "| Date | Version | Format | Link |\n" + + "| ---------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n" + + "| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) |\n" + + "| 2021-01-12 | 1.8.10 | Text | [Automating the Setup of a New Mac With All Your Apps, Preferences, and Development Tools](https://www.moncefbelyamani.com/automating-the-setup-of-a-new-mac-with-all-your-apps-preferences-and-development-tools/) |\n" + + "| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) |\n" + + "| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) |\n" + + "| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) |\n" + + "| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) |\n" + + "| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) |\n" + + "| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) |\n" + + "| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) |\n" + + "| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) |\n" + + "| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) |\n" + + "| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) |\n" + + "| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) |\n" + + "| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) |\n" + + "| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) |\n" + + "| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) |\n" + + "| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) |\n" + + "| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) |\n" + "\n" + "To add your article to this page please either [open an\n" + "issue](https://github.com/twpayne/chezmoi/issues/new/choose) or submit a pull\n" + diff --git a/docs/MEDIA.md b/docs/MEDIA.md index 8cc864645a5..66424611a29 100644 --- a/docs/MEDIA.md +++ b/docs/MEDIA.md @@ -8,25 +8,26 @@ Recommended video: [Conf42: chezmoi: Manage your dotfiles across multiple machin Recommended podcast: [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) -| Date | Version | Format | Link | -| ---------- | ------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) | -| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) | -| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) | -| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) | -| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) | -| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) | -| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) | -| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) | -| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) | -| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) | -| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) | -| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) | -| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) | -| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) | -| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) | -| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) | -| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) | +| Date | Version | Format | Link | +| ---------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 2021-02-06 | 1.8.10 | Video | [chezmoi: manage your dotfiles across multiple, diverse machines, securely](https://fosdem.org/2021/schedule/event/chezmoi/) | +| 2021-01-12 | 1.8.10 | Text | [Automating the Setup of a New Mac With All Your Apps, Preferences, and Development Tools](https://www.moncefbelyamani.com/automating-the-setup-of-a-new-mac-with-all-your-apps-preferences-and-development-tools/) | +| 2020-11-06 | 1.8.8 | Text | [Chezmoi – Securely Manage dotfiles across multiple machines](https://computingforgeeks.com/chezmoi-manage-dotfiles-across-multiple-machines/) | +| 2020-11-05 | 1.8.8 | Text | [Using chezmoi to manage dotfiles](https://pashinskikh.de/posts/chezmoi/) | +| 2020-10-05 | 1.8.6 | Text | [Dotfiles with /Chezmoi/](https://blog.lazkani.io/posts/backup/dotfiles-with-chezmoi/) | +| 2020-08-13 | 1.8.3 | Text | [Using BitWarden and Chezmoi to manage SSH keys](https://www.jx0.uk/chezmoi/bitwarden/unix/ssh/2020/08/13/bitwarden-chezmoi-ssh-key.html) | +| 2020-08-09 | 1.8.3 | Text | [Automating and testing dotfiles](https://seds.nl/posts/automating-and-testing-dotfiles/) | +| 2020-08-03 | 1.8.3 | Text | [Automating a Linux in Windows Dev Setup](https://matt.aimonetti.net/posts/2020-08-automating-a-linux-in-windows-dev-setup/) | +| 2020-07-06 | 1.8.3 | Video | [Conf42: chezmoi: Manage your dotfiles across multiple machines, securely](https://www.youtube.com/watch?v=JrCMCdvoMAw) | +| 2020-07-03 | 1.8.3 | Text | [Feeling at home in a LXD container](https://ubuntu.com/blog/feeling-at-home-in-a-lxd-container) | +| 2020-06-15 | 1.8.2 | Text | [Dotfiles management using chezmoi - How I Use Linux Desktop at Work Part5](https://blog.benoitj.ca/2020-06-15-how-i-use-linux-desktop-at-work-part5-dotfiles/) | +| 2020-04-27 | 1.8.0 | Text | [Managing my dotfiles with chezmoi](http://blog.emilieschario.com/post/managing-my-dotfiles-with-chezmoi/) | +| 2020-04-16 | 1.7.19 | Text (FR) | [Chezmoi, visite guidée](https://blog.wescale.fr/2020/04/16/chezmoi-visite-guidee/) | +| 2020-04-03 | 1.7.17 | Text | [Fedora Magazine: Take back your dotfiles with Chezmoi](https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/) | +| 2020-04-01 | 1.7.17 | Text | [Managing dotfiles and secret with chezmoi](https://blog.arkey.fr/2020/04/01/manage_dotfiles_with_chezmoi/) | +| 2020-03-12 | 1.7.16 | Video | [Managing Dotfiles with ChezMoi](https://www.youtube.com/watch?v=HXx6ugA98Qo) | +| 2019-11-20 | 1.7.2 | Audio/video | [FLOSS weekly episode 556: chezmoi](https://twit.tv/shows/floss-weekly/episodes/556) | +| 2019-01-10 | 0.0.11 | Text | [Linux Fu: The kitchen sync](https://hackaday.com/2019/01/10/linux-fu-the-kitchen-sync/) | To add your article to this page please either [open an issue](https://github.com/twpayne/chezmoi/issues/new/choose) or submit a pull
docs
Add link to blog post
473189051ec4950baa342f19ae7a824f0c1ded1f
2023-06-17 05:57:17
dependabot[bot]
chore(deps): bump actions/checkout from 3.5.2 to 3.5.3
false
diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index f0b554717b1..0a2a8013c05 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -6,7 +6,7 @@ jobs: govulncheck: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - name: go-version id: go-version run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 222bf4ab12c..edadd26476b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: outputs: code: ${{ steps.filter.outputs.code }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - id: filter uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 with: @@ -44,7 +44,7 @@ jobs: permissions: security-events: write steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 1 - uses: github/codeql-action/init@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e @@ -54,7 +54,7 @@ jobs: misspell: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: reviewdog/action-misspell@ccb0441a34ac2a3ece1206c63d7b6dd757ffde4d with: locale: US @@ -63,7 +63,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - 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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -85,7 +85,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: macos-12 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ~/.vagrant.d @@ -100,7 +100,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - name: test env: CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }} @@ -111,7 +111,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: macos-12 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ~/.vagrant.d @@ -126,7 +126,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: macos-11 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} @@ -156,7 +156,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: oldstable @@ -181,7 +181,7 @@ jobs: needs: changes runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 0 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 @@ -239,7 +239,7 @@ jobs: needs: changes runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 0 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 @@ -279,7 +279,7 @@ jobs: test-website: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} @@ -294,7 +294,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: windows-2019 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} @@ -333,7 +333,7 @@ jobs: check: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} @@ -359,7 +359,7 @@ jobs: if: github.event_name == 'push' || needs.changes.outputs.code == 'true' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: go-version: ${{ env.GO_VERSION }} @@ -397,7 +397,7 @@ jobs: run: snapcraft whoami env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 0 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 @@ -421,7 +421,7 @@ jobs: - release runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: fetch-depth: 0 - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
chore
bump actions/checkout from 3.5.2 to 3.5.3
8a83dcc1db41122949911b92e2e5837f4a208f20
2024-03-31 20:00:33
Tom Payne
fix: Skip adding entries in external dirs instead of erroring
false
diff --git a/internal/chezmoi/sourcestate.go b/internal/chezmoi/sourcestate.go index 65aa01f0926..883cd0d568c 100644 --- a/internal/chezmoi/sourcestate.go +++ b/internal/chezmoi/sourcestate.go @@ -313,20 +313,21 @@ type ReplaceFunc func(targetRelPath RelPath, newSourceStateEntry, oldSourceState // AddOptions are options to SourceState.Add. type AddOptions struct { - AutoTemplate bool // Automatically create templates, if possible. - Create bool // Add create_ entries instead of normal entries. - Encrypt bool // Encrypt files. - EncryptedSuffix string // Suffix for encrypted files. - Exact bool // Add the exact_ attribute to added directories. - Filter *EntryTypeFilter // Entry type filter. - OnIgnoreFunc func(RelPath) // Function to call when a target is ignored. - PreAddFunc PreAddFunc // Function to be called before a source entry is added. - ConfigFileAbsPath AbsPath // Path to config file. - ProtectedAbsPaths []AbsPath // Paths that must not be added. - RemoveDir RelPath // Directory to remove before adding. - ReplaceFunc ReplaceFunc // Function to be called before a source entry is replaced. - Template bool // Add the .tmpl attribute to added files. - TemplateSymlinks bool // Add symlinks with targets in the source or home directories as templates. + AutoTemplate bool // Automatically create templates, if possible. + Create bool // Add create_ entries instead of normal entries. + Encrypt bool // Encrypt files. + EncryptedSuffix string // Suffix for encrypted files. + Errorf func(string, ...any) // Function to print errors. + Exact bool // Add the exact_ attribute to added directories. + Filter *EntryTypeFilter // Entry type filter. + OnIgnoreFunc func(RelPath) // Function to call when a target is ignored. + PreAddFunc PreAddFunc // Function to be called before a source entry is added. + ConfigFileAbsPath AbsPath // Path to config file. + ProtectedAbsPaths []AbsPath // Paths that must not be added. + RemoveDir RelPath // Directory to remove before adding. + ReplaceFunc ReplaceFunc // Function to be called before a source entry is replaced. + Template bool // Add the .tmpl attribute to added files. + TemplateSymlinks bool // Add symlinks with targets in the source or home directories as templates. } // Add adds destAbsPathInfos to s. @@ -389,11 +390,19 @@ func (s *SourceState) Add( newSourceStateEntries := make(map[SourceRelPath]SourceStateEntry) newSourceStateEntriesByTargetRelPath := make(map[RelPath]SourceStateEntry) nonEmptyDirs := make(map[SourceRelPath]struct{}) + externalDirRelPaths := make(map[RelPath]struct{}) dirRenames := make(map[AbsPath]AbsPath) DEST_ABS_PATH: for _, destAbsPath := range destAbsPaths { targetRelPath := destAbsPath.MustTrimDirPrefix(s.destDirAbsPath) + // Skip any entries in known external dirs. + for externalDir := range externalDirRelPaths { + if targetRelPath.HasDirPrefix(externalDir) { + continue DEST_ABS_PATH + } + } + // Find the target's parent directory in the source state. var parentSourceRelPath SourceRelPath if targetParentRelPath := targetRelPath.Dir(); targetParentRelPath == DotRelPath { @@ -418,7 +427,13 @@ DEST_ABS_PATH: case i != len(nodes)-1 && !ok: panic(fmt.Errorf("nodes[%d]: unexpected non-terminal source state entry, got %T", i, node.sourceStateEntry)) case ok && sourceStateDir.Attr.External: - return fmt.Errorf("%s: cannot add entry in external_ directory", destAbsPath) + targetRelPathComponents := targetRelPath.SplitAll() + externalDirRelPath := EmptyRelPath.Join(targetRelPathComponents[:i]...) + externalDirRelPaths[externalDirRelPath] = struct{}{} + if options.Errorf != nil { + options.Errorf("%s: skipping entries in external_ directory\n", externalDirRelPath) + } + continue DEST_ABS_PATH } } parentSourceRelPath = nodes[len(nodes)-1].sourceStateEntry.SourceRelPath() diff --git a/internal/cmd/addcmd.go b/internal/cmd/addcmd.go index 0ee7871ef7a..480518416a5 100644 --- a/internal/cmd/addcmd.go +++ b/internal/cmd/addcmd.go @@ -187,6 +187,7 @@ func (c *Config) runAddCmd(cmd *cobra.Command, args []string, sourceState *chezm Encrypt: c.Add.Encrypt, EncryptedSuffix: c.encryption.EncryptedSuffix(), Exact: c.Add.exact, + Errorf: c.errorf, Filter: c.Add.filter, OnIgnoreFunc: c.defaultOnIgnoreFunc, PreAddFunc: c.defaultPreAddFunc, diff --git a/internal/cmd/importcmd.go b/internal/cmd/importcmd.go index 561b6c3ec86..a5dd3309b2e 100644 --- a/internal/cmd/importcmd.go +++ b/internal/cmd/importcmd.go @@ -88,6 +88,7 @@ func (c *Config) runImportCmd(cmd *cobra.Command, args []string, sourceState *ch archiveReaderSystem, archiveReaderSystem.FileInfos(), &chezmoi.AddOptions{ + Errorf: c.errorf, Exact: c._import.exact, Filter: c._import.filter, RemoveDir: removeDir, diff --git a/internal/cmd/mackupcmd_darwin.go b/internal/cmd/mackupcmd_darwin.go index 6effbf13fae..0e0ed986a82 100644 --- a/internal/cmd/mackupcmd_darwin.go +++ b/internal/cmd/mackupcmd_darwin.go @@ -109,6 +109,7 @@ func (c *Config) runMackupAddCmd(cmd *cobra.Command, args []string, sourceState c.destSystem, destAbsPathInfos, &chezmoi.AddOptions{ + Errorf: c.errorf, Filter: chezmoi.NewEntryTypeFilter(chezmoi.EntryTypesAll, chezmoi.EntryTypesNone), OnIgnoreFunc: c.defaultOnIgnoreFunc, PreAddFunc: c.defaultPreAddFunc, diff --git a/internal/cmd/readdcmd.go b/internal/cmd/readdcmd.go index 544d1b9c1e0..edf0e365439 100644 --- a/internal/cmd/readdcmd.go +++ b/internal/cmd/readdcmd.go @@ -146,6 +146,7 @@ TARGET_REL_PATH: if err := sourceState.Add(c.sourceSystem, c.persistentState, c.destSystem, destAbsPathInfos, &chezmoi.AddOptions{ Encrypt: sourceStateFile.Attr.Encrypted, EncryptedSuffix: c.encryption.EncryptedSuffix(), + Errorf: c.errorf, Filter: c.reAdd.filter, }); err != nil { return err diff --git a/internal/cmd/testdata/scripts/issue3525.txtar b/internal/cmd/testdata/scripts/issue3525.txtar index 631b8033f38..150dcc4d9c6 100644 --- a/internal/cmd/testdata/scripts/issue3525.txtar +++ b/internal/cmd/testdata/scripts/issue3525.txtar @@ -1,10 +1,10 @@ # test that chezmoi add does not add files in external_ directories -! exec chezmoi add $HOME${/}.external/file -stderr 'cannot add entry in external_ directory' +exec chezmoi add $HOME${/}.external/file +stderr '.external: skipping entries in external_ directory' # test that chezmoi add does not add files in subdirectories of external_ directories -! exec chezmoi add $HOME${/}.external/dir/file -stderr 'cannot add entry in external_ directory' +exec chezmoi add $HOME${/}.external/dir/file +stderr '.external: skipping entries in external_ directory' -- home/user/.external/dir/file -- # contents of .external/dir/file diff --git a/internal/cmd/testdata/scripts/issue3652.txtar b/internal/cmd/testdata/scripts/issue3652.txtar new file mode 100644 index 00000000000..5207e2c158c --- /dev/null +++ b/internal/cmd/testdata/scripts/issue3652.txtar @@ -0,0 +1,12 @@ +# test that chezmoi add skips files in external_ directories +exec chezmoi apply +exists $HOME/.dir/submodule/.git/.keep +exec chezmoi add $HOME${/}.dir +stderr '.dir/submodule: skipping entries in external_ directory' +cmp $CHEZMOISOURCEDIR/dot_dir/file golden/file + +-- golden/file -- +# contents of file +-- home/user/.dir/file -- +# contents of file +-- home/user/.local/share/chezmoi/dot_dir/external_submodule/.git/.keep --
fix
Skip adding entries in external dirs instead of erroring
d414e0fc7839ca97d20b82904a290ff444c4575c
2024-09-10 04:04:21
Tom Payne
docs: Add warning on using externals for large files or archives
false
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 21f464d9e7d..8185f2c2b09 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 @@ -84,6 +84,13 @@ update Oh My Zsh and its plugins, refresh the downloaded archives. For example, Oh My Zsh may cache completions in `.oh-my-zsh/cache/completions/`, which should be added to your `.chezmoiignore` file. +!!! warning + + Do not use externals for large files or archives. chezmoi validates the exact + contents of externals every time you run `chezmoi diff`, `chezmoi apply`, or + `chezmoi verify`. For large externals, use a `run_once_` or `run_onchange_` + script to unpack the archive or file once instead. + ## Include a subdirectory with selected files from a URL Use `include` pattern filters to include only selected files from an archive
docs
Add warning on using externals for large files or archives
c67b821d5f1c719b44c6cbb167c7c66f9bb01d81
2024-04-18 01:34:51
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index e934edb5a72..426bf89de9a 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ toolchain go1.22.0 require ( filippo.io/age v1.1.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.1.0 github.com/Masterminds/sprig/v3 v3.2.3 github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 github.com/Shopify/ejson v1.5.0 - github.com/alecthomas/assert/v2 v2.8.0 + github.com/alecthomas/assert/v2 v2.8.1 github.com/aws/aws-sdk-go-v2 v1.26.1 github.com/aws/aws-sdk-go-v2/config v1.27.11 github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.6 @@ -32,7 +32,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/combinator v0.3.0 github.com/muesli/termenv v0.15.2 - github.com/pelletier/go-toml/v2 v2.2.0 + github.com/pelletier/go-toml/v2 v2.2.1 github.com/rogpeppe/go-internal v1.12.0 github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 github.com/spf13/cobra v1.8.0 @@ -60,8 +60,8 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/BobuSumisu/aho-corasick v1.0.3 // indirect github.com/Masterminds/goutils v1.1.1 // indirect @@ -136,7 +136,7 @@ require ( github.com/rs/zerolog v1.32.0 // 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/shopspring/decimal v1.4.0 // indirect github.com/skeema/knownhosts v1.2.2 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -147,7 +147,7 @@ require ( github.com/yuin/goldmark v1.7.1 // indirect github.com/yuin/goldmark-emoji v1.0.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 // indirect + golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index eaac3dc1767..76f20b0242b 100644 --- a/go.sum +++ b/go.sum @@ -20,14 +20,14 @@ filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0 h1:sUFnFjzDUie80h24I7mrKtwCKgLY9L8h5Tp2x9+TWqk= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0/go.mod h1:52JbnQTp15qg5mRkMBHwp0j0ZFwHJ42Sx3zVV5RE9p0= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.1.0 h1:h4Zxgmi9oyZL2l8jeg1iRTqPloHktywWcu0nlJmo1tA= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.1.0/go.mod h1:LgLGXawqSreJz135Elog0ywTJDsm0Hz2k+N+6ZK35u8= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= -github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.1 h1:9fXQS/0TtQmKXp8SureKouF+idbQvp7cPUxykiohnBs= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.1/go.mod h1:f+OaoSg0VQYPMqB0Jp2D54j1VHzITYcJaCNwV+k00ts= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BobuSumisu/aho-corasick v1.0.3 h1:uuf+JHwU9CHP2Vx+wAy6jcksJThhJS9ehR8a+4nPE9g= @@ -48,8 +48,8 @@ github.com/Shopify/ejson v1.5.0 h1:SDV5HmQlpn3hSUiw9HV0nOj9tpzup5i0OV71ioLYkpw= github.com/Shopify/ejson v1.5.0/go.mod h1:a4+JLWuTe9+tTofPBGWZoqzf0af6eQKGmFqbxoMSARc= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/alecthomas/assert/v2 v2.8.0 h1:8b0foWfS2dH6MltxQMPvWdSGN1wE4K1vyab9PGW4qgE= -github.com/alecthomas/assert/v2 v2.8.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/assert/v2 v2.8.1 h1:YCxnYR6jjpfnEK5AK5SysALKdUEBPGH4Y7As6tBnDw0= +github.com/alecthomas/assert/v2 v2.8.1/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.13.0 h1:VP72+99Fb2zEcYM0MeaWJmV+xQvz5v5cxRHd+ooU1lI= github.com/alecthomas/chroma/v2 v2.13.0/go.mod h1:BUGjjsD+ndS6eX37YgTchSEG+Jg9Jv1GiZs9sqPqztk= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= @@ -304,6 +304,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w 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/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= 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= @@ -328,8 +330,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= 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.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= -github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= +github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= @@ -368,8 +370,8 @@ github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f/go.mod h1:VFvziUEIM github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= 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/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -466,8 +468,8 @@ 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.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 h1:ESSUROHIBHg7USnszlcdmjBEwdMj9VUvU+OPk4yl2mc= -golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
chore
Update dependencies
d04c97ae675fbbf109dc4cad7e7becdb434f8918
2023-03-19 20:56:17
Tom Payne
chore: Update golangci-lint to v1.52.0
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c044955c51a..573e5ce27eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ env: AGE_VERSION: 1.1.1 GO_VERSION: 1.20.2 GOFUMPT_VERSION: 0.4.0 - GOLANGCI_LINT_VERSION: 1.51.2 + GOLANGCI_LINT_VERSION: 1.52.0 GOVERSIONINFO_VERSION: 1.4.0 jobs: changes: diff --git a/.golangci.yml b/.golangci.yml index 72cd1018719..4af9f309523 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -54,6 +54,8 @@ linters: - promlinter - reassign - revive + - rowserrcheck + - sqlclosecheck - staticcheck - stylecheck - tagliatelle @@ -65,6 +67,7 @@ linters: - unparam - unused - usestdlibvars + - wastedassign - whitespace disable: - asasalint @@ -90,11 +93,9 @@ linters: - nlreturn - nonamedreturns - paralleltest - - rowserrcheck # https://github.com/golangci/golangci-lint/issues/2649 - testpackage - tparallel - varnamelen - - wastedassign # https://github.com/golangci/golangci-lint/issues/2649 - wrapcheck - wsl @@ -148,11 +149,14 @@ linters-settings: issues: include: - - EXC0011 # include issues about comments from `stylecheck` + - EXC0011 # include issues about comments from `stylecheck` exclude-rules: - linters: - goerr113 text: do not define dynamic errors, use wrapped static errors instead + - linters: + - revive + text: unused-parameter - linters: - forbidigo - gosec diff --git a/pkg/chezmoi/autotemplate.go b/pkg/chezmoi/autotemplate.go index 3053b56d7d6..12a0901f34b 100644 --- a/pkg/chezmoi/autotemplate.go +++ b/pkg/chezmoi/autotemplate.go @@ -74,10 +74,9 @@ func autoTemplate(contents []byte, data map[string]any) ([]byte, bool) { if j == -1 { // No more occurrences found, so terminate the loop. break - } else { - // Advance to the next occurrence. - index += j } + // Advance to the next occurrence. + index += j } } diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index c29a46cb322..d6b57bdc733 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -671,10 +671,7 @@ func (c *Config) createAndReloadConfigFile(cmd *cobra.Command) error { } if configTemplate == nil { - if err := c.persistentState.Delete(chezmoi.ConfigStateBucket, configStateKey); err != nil { - return err - } - return nil + return c.persistentState.Delete(chezmoi.ConfigStateBucket, configStateKey) } configFileContents, err := c.createConfigFile(configTemplate.targetRelPath, configTemplate.contents, cmd) @@ -714,11 +711,7 @@ func (c *Config) createAndReloadConfigFile(cmd *cobra.Command) error { if err := c.decodeConfigBytes(configTemplate.format, configFileContents, &c.ConfigFile); err != nil { return fmt.Errorf("%s: %w", configTemplate.sourceAbsPath, err) } - if err := c.setEncryption(); err != nil { - return err - } - - return nil + return c.setEncryption() } // createConfigFile creates a config file using a template and returns its @@ -858,10 +851,7 @@ func (c *Config) decodeConfigMap(configMap map[string]any, configFile *ConfigFil if err != nil { return err } - if err := decoder.Decode(configMap); err != nil { - return err - } - return nil + return decoder.Decode(configMap) } // defaultPreApplyFunc is the default pre-apply function. If the target entry @@ -1584,7 +1574,7 @@ func (c *Config) persistentPostRunRootE(cmd *cobra.Command, args []string) error var format chezmoi.Format if format, err = chezmoi.FormatFromAbsPath(c.configFileAbsPath); err == nil { var config map[string]any - if err = format.Unmarshal(configFileContents, &config); err != nil { + if err = format.Unmarshal(configFileContents, &config); err != nil { //nolint:revive // err is already set, do nothing. } else { err = c.decodeConfigMap(config, &ConfigFile{}) diff --git a/pkg/cmd/doctorcmd.go b/pkg/cmd/doctorcmd.go index 258ceb66cd4..56cddb22fd7 100644 --- a/pkg/cmd/doctorcmd.go +++ b/pkg/cmd/doctorcmd.go @@ -498,9 +498,7 @@ func (c *configFileCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsP case 0: return checkResultOK, "no config file found" case 1: - var filenameAbsPath chezmoi.AbsPath - for filenameAbsPath = range filenameAbsPaths { - } + filenameAbsPath := anyKey(filenameAbsPaths) if filenameAbsPath != c.expected { return checkResultFailed, fmt.Sprintf("found %s, expected %s", filenameAbsPath, c.expected) } @@ -741,3 +739,13 @@ func (c *versionCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsPath } return checkResultOK, c.versionStr } + +// anyKey returns any key from m. It is typically used to return a single key +// when m is known to contain exactly one element. +func anyKey[M ~map[K]V, K comparable, V any](m M) K { //nolint:ireturn + for k := range m { + return k + } + var k K + return k +} diff --git a/pkg/cmd/editcmd.go b/pkg/cmd/editcmd.go index 6078e9dffff..e5ddb15c8d3 100644 --- a/pkg/cmd/editcmd.go +++ b/pkg/cmd/editcmd.go @@ -244,9 +244,5 @@ TARGETRELPATH: return err } - if err := postEditFunc(); err != nil { - return err - } - - return nil + return postEditFunc() }
chore
Update golangci-lint to v1.52.0
c25bd06c93e87c40e226000c6e577b0e69f95834
2023-11-26 08:30:13
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 0be0ffd0433..81f46957107 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/Shopify/ejson v1.4.1 github.com/alecthomas/assert/v2 v2.4.0 - github.com/aws/aws-sdk-go-v2 v1.23.0 - github.com/aws/aws-sdk-go-v2/config v1.25.3 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.2 + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/config v1.25.5 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.3 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.16.1 @@ -71,16 +71,16 @@ 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.2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.17.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.25.4 // indirect github.com/aws/smithy-go v1.17.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect diff --git a/go.sum b/go.sum index 5060797002a..e6c5736ca45 100644 --- a/go.sum +++ b/go.sum @@ -50,32 +50,32 @@ 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.23.0 h1:PiHAzmiQQr6JULBUdvR8fKlA+UPKLT/8KbiqpFBWiAo= -github.com/aws/aws-sdk-go-v2 v1.23.0/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= -github.com/aws/aws-sdk-go-v2/config v1.25.3 h1:E4m9LbwJOoncDNt3e9MPLbz/saxWcGUlZVBydydD6+8= -github.com/aws/aws-sdk-go-v2/config v1.25.3/go.mod h1:tAByZy03nH5jcq0vZmkcVoo6tRzRHEwSFx3QW4NmDw8= -github.com/aws/aws-sdk-go-v2/credentials v1.16.2 h1:0sdZ5cwfOAipTzZ7eOL0gw4LAhk/RZnTa16cDqIt8tg= -github.com/aws/aws-sdk-go-v2/credentials v1.16.2/go.mod h1:sDdvGhXrSVT5yzBDR7qXz+rhbpiMpUYfF3vJ01QSdrc= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4 h1:9wKDWEjwSnXZre0/O3+ZwbBl1SmlgWYBbrTV10X/H1s= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.4/go.mod h1:t4i+yGHMCcUNIX1x7YVYa6bH/Do7civ5I6cG/6PMfyA= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 h1:DUwbD79T8gyQ23qVXFUthjzVMTviSHi3y4z58KvghhM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3/go.mod h1:7sGSz1JCKHWWBHq98m6sMtWQikmYPpxjqOydDemiVoM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 h1:AplLJCtIaUZDCbr6+gLYdsYNxne4iuaboJhVt9d+WXI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3/go.mod h1:ify42Rb7nKeDDPkFjKn7q1bPscVPu/+gmHH8d2c+anU= +github.com/aws/aws-sdk-go-v2 v1.23.1 h1:qXaFsOOMA+HsZtX8WoCa+gJnbyW7qyFFBlPqvTSzbaI= +github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= +github.com/aws/aws-sdk-go-v2/config v1.25.5 h1:UGKm9hpQS2hoK8CEJ1BzAW8NbUpvwDJJ4lyqXSzu8bk= +github.com/aws/aws-sdk-go-v2/config v1.25.5/go.mod h1:Bf4gDvy4ZcFIK0rqDu1wp9wrubNba2DojiPB2rt6nvI= +github.com/aws/aws-sdk-go-v2/credentials v1.16.4 h1:i7UQYYDSJrtc30RSwJwfBKwLFNnBTiICqAJ0pPdum8E= +github.com/aws/aws-sdk-go-v2/credentials v1.16.4/go.mod h1:Kdh/okh+//vQ/AjEt81CjvkTo64+/zIE4OewP7RpfXk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5 h1:KehRNiVzIfAcj6gw98zotVbb/K67taJE0fkfgM6vzqU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5/go.mod h1:VhnExhw6uXy9QzetvpXDolo1/hjhx4u9qukBGkuUwjs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 h1:LAm3Ycm9HJfbSCd5I+wqC2S9Ej7FPrgr5CQoOljJZcE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4/go.mod h1:xEhvbJcyUf/31yfGSQBe01fukXwXJ0gxDp7rLfymWE0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 h1:4GV0kKZzUxiWxSVpn/9gwR0g21NF1Jsyduzo9rHgC/Q= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4/go.mod h1:dYvTNAggxDZy6y1AF7YDwXsPuHFy/VNEpEI/2dWK9IU= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 h1:rpkF4n0CyFcrJUG/rNNohoTmhtWlFTRI4BsZOh9PvLs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1/go.mod h1:l9ymW25HOqymeU2m1gbUQ3rUIsTwKs8gYHXkqDQUhiI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3 h1:kJOolE8xBAD13xTCgOakByZkyP4D/owNmvEiioeUNAg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.3/go.mod h1:Owv1I59vaghv1Ax8zz8ELY8DN7/Y0rGS+WWAmjgi950= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.2 h1:M5NodszNDBfyfFBKoAzJY0flmkkQCg7MGk6+/vBGjCM= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.2/go.mod h1:+8dYLQz+I30HIGyhp+6htf3+yyGTqBzzTOG90Ai8lWs= -github.com/aws/aws-sdk-go-v2/service/sso v1.17.2 h1:V47N5eKgVZoRSvx2+RQ0EpAEit/pqOhqeSQFiS4OFEQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.17.2/go.mod h1:/pE21vno3q1h4bbhUOEi+6Zu/aT26UK2WKkDXd+TssQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0 h1:/XiEU7VIFcVWRDQLabyrSjBoKIm8UkYgsvWDuFW8Img= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.0/go.mod h1:dWqm5G767qwKPuayKfzm4rjzFmVjiBFbOJrpSPnAMDs= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.3 h1:M2w4kiMGJCCM6Ljmmx/l6mmpfa3gPJVpBencfnsgvqs= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.3/go.mod h1:4EqRHDCKP78hq3zOnmFXu5k0j4bXbRFfCh/zQ6KnEfQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4 h1:rdovz3rEu0vZKbzoMYPTehp0E8veoE9AyfzqCr5Eeao= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4/go.mod h1:aYCGNjyUCUelhofxlZyj63srdxWUSsBSGg5l6MCuXuE= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.3 h1:NurfTBFmaehSiWMv5drydRWs3On0kwoBe1gWYFt+5ws= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.3/go.mod h1:LDD9wCQ1tvjMIWEIFPvZ8JgJsEOjded+X5jav9tD/zg= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.3 h1:CdsSOGlFF3Pn+koXOIpTtvX7st0IuGsZ8kJqcWMlX54= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.3/go.mod h1:oA6VjNsLll2eVuUoF2D+CMyORgNzPEW/3PyUdq6WQjI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.1 h1:cbRqFTVnJV+KRpwFl76GJdIZJKKCdTPnjUZ7uWh3pIU= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.1/go.mod h1:hHL974p5auvXlZPIjJTblXJpbkfK4klBczlsEaMCGVY= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.4 h1:yEvZ4neOQ/KpUqyR+X0ycUTW/kVRNR4nDZ38wStHGAA= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.4/go.mod h1:feTnm2Tk/pJxdX+eooEsxvlvTWBvDm6CasRZ+JOs2IY= github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/aymanbagabas/go-osc52 v1.0.3 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg=
chore
Update dependencies
3782a70b76c645645051182b1c7ffca5174ac075
2024-12-04 04:47:10
Tom Payne
chore: Build with Go 1.23.4
false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56892521508..874f0898839 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ env: CHOCOLATEY_VERSION: 2.4.0 # https://github.com/chocolatey/choco/releases EDITORCONFIG_CHECKER_VERSION: 3.0.3 # https://github.com/editorconfig-checker/editorconfig-checker/releases FIND_TYPOS_VERSION: 0.0.3 # https://github.com/twpayne/find-typos/tags - GO_VERSION: 1.23.3 # https://go.dev/doc/devel/release + GO_VERSION: 1.23.4 # https://go.dev/doc/devel/release GOFUMPT_VERSION: 0.7.0 # https://github.com/mvdan/gofumpt/releases GOLANGCI_LINT_VERSION: 1.62.2 # https://github.com/golangci/golangci-lint/releases GOLINES_VERSION: 0.12.2 # https://github.com/segmentio/golines/releases
chore
Build with Go 1.23.4
b33959debdb9874cf77e26c330a0b252c852d8a4
2024-03-30 05:09:54
Tom Payne
chore: Update dependencies
false
diff --git a/go.mod b/go.mod index 121b2d38ace..8d4af66addd 100644 --- a/go.mod +++ b/go.mod @@ -11,15 +11,15 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 github.com/Shopify/ejson v1.5.0 - github.com/alecthomas/assert/v2 v2.6.0 - github.com/aws/aws-sdk-go-v2 v1.25.3 - github.com/aws/aws-sdk-go-v2/config v1.27.7 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.2 + github.com/alecthomas/assert/v2 v2.7.0 + github.com/aws/aws-sdk-go-v2 v1.26.0 + github.com/aws/aws-sdk-go-v2/config v1.27.9 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.5 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/bradenhilton/mozillainstallhash v1.0.1 github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 - github.com/charmbracelet/glamour v0.6.0 + github.com/charmbracelet/glamour v0.7.0 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 @@ -32,7 +32,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/combinator v0.3.0 github.com/muesli/termenv v0.15.2 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.0 github.com/rogpeppe/go-internal v1.12.0 github.com/sergi/go-diff v1.1.0 github.com/spf13/cobra v1.8.0 @@ -43,7 +43,7 @@ require ( github.com/twpayne/go-vfs/v5 v5.0.3 github.com/twpayne/go-xdg/v6 v6.1.2 github.com/ulikunitz/xz v0.5.11 - github.com/zalando/go-keyring v0.2.3 + github.com/zalando/go-keyring v0.2.4 github.com/zricethezav/gitleaks/v8 v8.18.2 go.etcd.io/bbolt v1.3.9 golang.org/x/crypto v0.21.0 @@ -68,20 +68,20 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect - github.com/alecthomas/chroma v0.10.0 // indirect + github.com/alecthomas/chroma/v2 v2.13.0 // indirect github.com/alecthomas/repr v0.4.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.17.7 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.20.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.28.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 // indirect github.com/aws/smithy-go v1.20.1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect @@ -138,7 +138,7 @@ require ( 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/skeema/knownhosts v1.2.2 // 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 @@ -148,7 +148,7 @@ require ( github.com/yuin/goldmark v1.7.0 // indirect github.com/yuin/goldmark-emoji v1.0.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect golang.org/x/mod v0.16.0 // indirect golang.org/x/net v0.22.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index 1da5476a3ea..a7ff7ad845c 100644 --- a/go.sum +++ b/go.sum @@ -48,10 +48,10 @@ github.com/Shopify/ejson v1.5.0 h1:SDV5HmQlpn3hSUiw9HV0nOj9tpzup5i0OV71ioLYkpw= github.com/Shopify/ejson v1.5.0/go.mod h1:a4+JLWuTe9+tTofPBGWZoqzf0af6eQKGmFqbxoMSARc= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= -github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= -github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= +github.com/alecthomas/assert/v2 v2.7.0 h1:QtqSACNS3tF7oasA8CU6A6sXZSBDqnm7RfpLl9bZqbE= +github.com/alecthomas/assert/v2 v2.7.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/chroma/v2 v2.13.0 h1:VP72+99Fb2zEcYM0MeaWJmV+xQvz5v5cxRHd+ooU1lI= +github.com/alecthomas/chroma/v2 v2.13.0/go.mod h1:BUGjjsD+ndS6eX37YgTchSEG+Jg9Jv1GiZs9sqPqztk= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= @@ -64,36 +64,34 @@ 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.25.3 h1:xYiLpZTQs1mzvz5PaI6uR0Wh57ippuEthxS4iK5v0n0= -github.com/aws/aws-sdk-go-v2 v1.25.3/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I= -github.com/aws/aws-sdk-go-v2/config v1.27.7 h1:JSfb5nOQF01iOgxFI5OIKWwDiEXWTyTgg1Mm1mHi0A4= -github.com/aws/aws-sdk-go-v2/config v1.27.7/go.mod h1:PH0/cNpoMO+B04qET699o5W92Ca79fVtbUnvMIZro4I= -github.com/aws/aws-sdk-go-v2/credentials v1.17.7 h1:WJd+ubWKoBeRh7A5iNMnxEOs982SyVKOJD+K8HIezu4= -github.com/aws/aws-sdk-go-v2/credentials v1.17.7/go.mod h1:UQi7LMR0Vhvs+44w5ec8Q+VS+cd10cjwgHwiVkE0YGU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.3 h1:p+y7FvkK2dxS+FEwRIDHDe//ZX+jDhP8HHE50ppj4iI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.3/go.mod h1:/fYB+FZbDlwlAiynK9KDXlzZl3ANI9JkD0Uhz5FjNT4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3 h1:ifbIbHZyGl1alsAhPIYsHOg5MuApgqOvVeI8wIugXfs= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3/go.mod h1:oQZXg3c6SNeY6OZrDY+xHcF4VGIEoNotX2B4PrDeoJI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3 h1:Qvodo9gHG9F3E8SfYOspPeBt0bjSbsevK8WhRAUHcoY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3/go.mod h1:vCKrdLXtybdf/uQd/YfVR2r5pcbNuEYKzMQpcxmeSJw= +github.com/aws/aws-sdk-go-v2 v1.26.0 h1:/Ce4OCiM3EkpW7Y+xUnfAFpchU78K7/Ug01sZni9PgA= +github.com/aws/aws-sdk-go-v2 v1.26.0/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I= +github.com/aws/aws-sdk-go-v2/config v1.27.9 h1:gRx/NwpNEFSk+yQlgmk1bmxxvQ5TyJ76CWXs9XScTqg= +github.com/aws/aws-sdk-go-v2/config v1.27.9/go.mod h1:dK1FQfpwpql83kbD873E9vz4FyAxuJtR22wzoXn3qq0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.9 h1:N8s0/7yW+h8qR8WaRlPQeJ6czVMNQVNtNdUqf6cItao= +github.com/aws/aws-sdk-go-v2/credentials v1.17.9/go.mod h1:446YhIdmSV0Jf/SLafGZalQo+xr2iw7/fzXGDPTU1yQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 h1:af5YzcLf80tv4Em4jWVD75lpnOHSBkPUZxZfGkrI3HI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0/go.mod h1:nQ3how7DMnFMWiU1SpECohgC82fpn4cKZ875NDMmwtA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 h1:0ScVK/4qZ8CIW0k8jOeFVsyS/sAiXpYxRBLolMkuLQM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4/go.mod h1:84KyjNZdHC6QZW08nfHI6yZgPd+qRgaWcYsyLUo3QY8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 h1:sHmMWWX5E7guWEFQ9SVo6A3S4xpPrWnd77a6y4WM6PU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4/go.mod h1:WjpDrhWisWOIoS9n3nk67A3Ll1vfULJ9Kq6h29HTD48= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.5 h1:K/NXvIftOlX+oGgWGIa3jDyYLDNsdVhsjHmsBH2GLAQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.5/go.mod h1:cl9HGLV66EnCmMNzq4sYOti+/xo8w34CsgzVtm2GgsY= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.2 h1:WrqqLhD5St2cbXsvR0yuY43pdhXsUL0yjQepBJIpTvI= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.2/go.mod h1:GvNHKQAAOSKjmlccE/+Ww2gDbwYP9EewIuvWiQSquQs= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.2 h1:XOPfar83RIRPEzfihnp+U6udOveKZJvPQ76SKWrLRHc= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.2/go.mod h1:Vv9Xyk1KMHXrR3vNQe8W5LMFdTjSeWk0gBZBzvf3Qa0= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 h1:pi0Skl6mNl2w8qWZXcdOyg197Zsf4G97U7Sso9JXGZE= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2/go.mod h1:JYzLoEVeLXk+L4tn1+rrkfhkxl6mLDEVaDSvGq9og90= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.4 h1:Ppup1nVNAOWbBOrcoOxaxPeEnSFB2RnnQdguhXpmeQk= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.4/go.mod h1:+K1rNPVyGxkRuv9NNiaZ4YhBFuyw2MMA9SlIJ1Zlpz8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 h1:b+E7zIUHMmcB4Dckjpkapoy47W6C9QBv/zoUP+Hn8Kc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6/go.mod h1:S2fNV0rxrP78NhPbCZeQgY8H9jdDMeGtwcfZIRxzBqU= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.5 h1:1i3Pq5g1NaXI/u8lTHRVMHyCc0HoZzSk2EFmiy14Hbk= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.28.5/go.mod h1:slgOMs1CQu8UVgwoFqEvCi71L4HVoZgM0r8MtcNP6Mc= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 h1:mnbuWHOcM70/OFUlZZ5rcdfA8PflGXXiefU/O+1S3+8= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3/go.mod h1:5HFu51Elk+4oRBZVxmHrSds5jFXmFj8C3w7DVF2gnrs= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 h1:uLq0BKatTmDzWa/Nu4WO0M1AaQDaPpwTKAeByEc6WFM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3/go.mod h1:b+qdhjnxj8GSR6t5YfphOffeoQSQ1KmpoVVuBn+PWxs= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 h1:J/PpTf/hllOjx8Xu9DMflff3FajfLxqM5+tepvVXmxg= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5/go.mod h1:0ih0Z83YDH/QeQ6Ori2yGE2XvWYv/Xm+cZc01LC6oK0= github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= -github.com/aymanbagabas/go-osc52 v1.0.3 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg= -github.com/aymanbagabas/go-osc52 v1.0.3/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= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= @@ -110,8 +108,8 @@ github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/ github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM= github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= -github.com/charmbracelet/glamour v0.6.0 h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc= -github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc= +github.com/charmbracelet/glamour v0.7.0 h1:2BtKGZ4iVJCDfMF229EzbeR1QRKLWztO9dMtjmqZSng= +github.com/charmbracelet/glamour v0.7.0/go.mod h1:jUMh5MeihljJPQbJ/wf4ldw2+yBP59+ctV36jASy7ps= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.10.0 h1:KWeXFSexGcfahHX+54URiZGkBFazf70JNMtwg/AFW3s= @@ -139,7 +137,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= @@ -212,7 +209,6 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= 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= @@ -291,10 +287,8 @@ github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2J github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -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/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -323,7 +317,6 @@ github.com/muesli/combinator v0.3.0 h1:SZDuRzzwmVPLkbOzbhGzBTwd5+Y6aFN4UusOW2azr github.com/muesli/combinator v0.3.0/go.mod h1:ttPegJX0DPQaGDtJKMInIP6Vfp5pN8RX7QntFCcpy18= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -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= @@ -338,8 +331,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= 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= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= @@ -383,8 +376,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= 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/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY= github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= @@ -406,17 +399,18 @@ 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/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 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= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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= @@ -439,17 +433,14 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= 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.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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= github.com/yuin/goldmark v1.7.0 h1:EfOIvIMZIzHdB/R/zVrikYLPPwJlfMcNczJFMs1m6sA= github.com/yuin/goldmark v1.7.0/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= -github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= github.com/yuin/goldmark-emoji v1.0.2 h1:c/RgTShNgHTtc6xdz2KKI74jJr6rWi7FPgnP9GAsO5s= github.com/yuin/goldmark-emoji v1.0.2/go.mod h1:RhP/RWpexdp+KHs7ghKnifRoIs/Bq4nDS7tRbCkOwKY= -github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= -github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= +github.com/zalando/go-keyring v0.2.4 h1:wi2xxTqdiwMKbM6TWwi+uJCG/Tum2UV0jqaQhCa9/68= +github.com/zalando/go-keyring v0.2.4/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= github.com/zricethezav/gitleaks/v8 v8.18.2 h1:slo/sMmgs3qA+6Vv6iqVhsCv+gsl3RekQXqDN0M4g5M= github.com/zricethezav/gitleaks/v8 v8.18.2/go.mod h1:8F5GrdCpEtyN5R+0MKPubbOPqIHptNckH3F7bYrhT+Y= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= @@ -480,8 +471,8 @@ 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.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= 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.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= @@ -490,7 +481,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 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= 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.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= @@ -513,7 +503,6 @@ golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
chore
Update dependencies
5b82d611ad9d453a6a67d698e73dac1e8cb62b80
2023-04-05 21:36:53
Tom Payne
chore: Tidy up internal names
false
diff --git a/pkg/chezmoi/sourcestate.go b/pkg/chezmoi/sourcestate.go index 7148d63dfa3..69798f3440f 100644 --- a/pkg/chezmoi/sourcestate.go +++ b/pkg/chezmoi/sourcestate.go @@ -329,7 +329,7 @@ func (s *SourceState) Add( newSourceStateEntriesByTargetRelPath := make(map[RelPath]SourceStateEntry) nonEmptyDirs := make(map[SourceRelPath]struct{}) dirRenames := make(map[AbsPath]AbsPath) -DESTABSPATH: +DEST_ABS_PATH: for _, destAbsPath := range destAbsPaths { destAbsPathInfo := destAbsPathInfos[destAbsPath] if !options.Filter.IncludeFileInfo(destAbsPathInfo) { @@ -374,7 +374,7 @@ DESTABSPATH: if options.PreAddFunc != nil { switch err := options.PreAddFunc(targetRelPath); { case errors.Is(err, Skip): - continue DESTABSPATH + continue DEST_ABS_PATH case err != nil: return err } @@ -398,7 +398,7 @@ DESTABSPATH: if options.ReplaceFunc != nil { switch err := options.ReplaceFunc(targetRelPath, newSourceStateEntry, oldSourceStateEntry); { case errors.Is(err, Skip): - continue DESTABSPATH + continue DEST_ABS_PATH case err != nil: return err } @@ -413,7 +413,7 @@ DESTABSPATH: oldSourceAbsPath := s.sourceDirAbsPath.Join(oldSourceEntryRelPath.RelPath()) newSourceAbsPath := s.sourceDirAbsPath.Join(sourceEntryRelPath.RelPath()) dirRenames[oldSourceAbsPath] = newSourceAbsPath - continue DESTABSPATH + continue DEST_ABS_PATH } // Otherwise, remove the old entry. diff --git a/pkg/cmd/annotation.go b/pkg/cmd/annotation.go index 4b19b6a6c86..48b47414860 100644 --- a/pkg/cmd/annotation.go +++ b/pkg/cmd/annotation.go @@ -17,7 +17,7 @@ var ( // Persistent state modes. const ( - persistentStateModeKey = "chezoi_persistent_state_mode" + persistentStateModeKey = "chezmoi_persistent_state_mode" persistentStateModeEmpty persistentStateMode = "empty" persistentStateModeReadOnly persistentStateMode = "read-only" diff --git a/pkg/cmd/bitwardentemplatefuncs.go b/pkg/cmd/bitwardentemplatefuncs.go index 8985005b83c..e555268defe 100644 --- a/pkg/cmd/bitwardentemplatefuncs.go +++ b/pkg/cmd/bitwardentemplatefuncs.go @@ -14,8 +14,8 @@ type bitwardenConfig struct { outputCache map[string][]byte } -func (c *Config) bitwardenAttachmentTemplateFunc(name, itemid string) string { - output, err := c.bitwardenOutput([]string{"get", "attachment", name, "--itemid", itemid, "--raw"}) +func (c *Config) bitwardenAttachmentTemplateFunc(name, itemID string) string { + output, err := c.bitwardenOutput([]string{"get", "attachment", name, "--itemid", itemID, "--raw"}) if err != nil { panic(err) } diff --git a/pkg/cmd/editcmd.go b/pkg/cmd/editcmd.go index e5ddb15c8d3..7e5de8bfa82 100644 --- a/pkg/cmd/editcmd.go +++ b/pkg/cmd/editcmd.go @@ -90,7 +90,7 @@ func (c *Config) runEditCmd(cmd *cobra.Command, args []string) error { decryptedAbsPath chezmoi.AbsPath } var transparentlyDecryptedFiles []transparentlyDecryptedFile -TARGETRELPATH: +TARGET_REL_PATH: for _, targetRelPath := range targetRelPaths { sourceStateEntry := sourceState.MustEntry(targetRelPath) sourceRelPath := sourceStateEntry.SourceRelPath() @@ -154,7 +154,7 @@ TARGETRELPATH: } if err := c.baseSystem.Link(c.SourceDirAbsPath.Join(sourceRelPath.RelPath()), hardlinkAbsPath); err == nil { editorArgs = append(editorArgs, hardlinkAbsPath.String()) - continue TARGETRELPATH + continue TARGET_REL_PATH } // Otherwise, fall through to the default option of editing the diff --git a/pkg/cmd/forgetcmd.go b/pkg/cmd/forgetcmd.go index a100df6b62f..e9204824da1 100644 --- a/pkg/cmd/forgetcmd.go +++ b/pkg/cmd/forgetcmd.go @@ -35,7 +35,7 @@ func (c *Config) runForgetCmd(cmd *cobra.Command, args []string, sourceState *ch return err } -TARGETRELPATH: +TARGET_REL_PATH: for _, targetRelPath := range targetRelPaths { sourceStateEntry := sourceState.MustEntry(targetRelPath) @@ -46,10 +46,10 @@ TARGETRELPATH: // OK, keep going. case chezmoi.SourceStateOriginRemove: c.errorf("warning: %s: cannot forget entry from remove\n", targetRelPath) - continue TARGETRELPATH + continue TARGET_REL_PATH case *chezmoi.External: c.errorf("warning: %s: cannot forget entry from external %s\n", targetRelPath, sourceStateOrigin.OriginString()) - continue TARGETRELPATH + continue TARGET_REL_PATH default: panic(fmt.Sprintf("%s: %T: unknown source state origin type", targetRelPath, sourceStateOrigin)) } diff --git a/pkg/cmd/readdcmd.go b/pkg/cmd/readdcmd.go index 89db13d9e97..4d412164520 100644 --- a/pkg/cmd/readdcmd.go +++ b/pkg/cmd/readdcmd.go @@ -50,7 +50,7 @@ func (c *Config) runReAddCmd(cmd *cobra.Command, args []string, sourceState *che }) sort.Sort(targetRelPaths) -TARGETRELPATH: +TARGET_REL_PATH: for _, targetRelPath := range targetRelPaths { sourceStateFile, ok := sourceStateEntries[targetRelPath].(*chezmoi.SourceStateFile) if !ok { @@ -118,7 +118,7 @@ TARGETRELPATH: case choice == "yes": break FOR case choice == "no": - continue TARGETRELPATH + continue TARGET_REL_PATH case choice == "all": c.interactive = false break FOR diff --git a/pkg/cmd/testdata/scripts/issue2628.txtar b/pkg/cmd/testdata/scripts/issue2628.txtar index e9e985945cb..8de6551e177 100644 --- a/pkg/cmd/testdata/scripts/issue2628.txtar +++ b/pkg/cmd/testdata/scripts/issue2628.txtar @@ -6,7 +6,7 @@ cmp $HOME/.file golden/.file chhome home2/user -# test that .chezmoignore.tmpl is read +# test that .chezmoiignore.tmpl is read exec chezmoi apply ! exists $HOME/.file diff --git a/pkg/cmd/util.go b/pkg/cmd/util.go index 990bfa2a66d..1243005b0e9 100644 --- a/pkg/cmd/util.go +++ b/pkg/cmd/util.go @@ -111,8 +111,8 @@ func pluralize(singular string) string { return singular + "s" } -// titleize returns s with its first rune titleized. -func titleize(s string) string { +// titleFirst returns s with its first rune converted to title case. +func titleFirst(s string) string { if s == "" { return s } @@ -128,7 +128,7 @@ func upperSnakeCaseToCamelCase(s string) string { if i == 0 { words[i] = strings.ToLower(word) } else if !isWellKnownAbbreviation(word) { - words[i] = titleize(strings.ToLower(word)) + words[i] = titleFirst(strings.ToLower(word)) } } return strings.Join(words, "")
chore
Tidy up internal names
bc22729bd6ff3fed82bddd500edfb7a8f8d46e92
2024-03-01 08:15:45
dependabot[bot]
chore(deps-dev): bump ruff from 0.1.15 to 0.3.0 in /assets
false
diff --git a/assets/requirements.dev.txt b/assets/requirements.dev.txt index 43172de7382..470e282b510 100644 --- a/assets/requirements.dev.txt +++ b/assets/requirements.dev.txt @@ -1 +1 @@ -ruff==0.1.15 +ruff==0.3.0
chore
bump ruff from 0.1.15 to 0.3.0 in /assets