diff --git a/README.md b/README.md index 9606711..0622645 100644 --- a/README.md +++ b/README.md @@ -330,6 +330,8 @@ Commands: supported-system remove remove a supported system checksums add add checksums to the config file checksums prune remove unnecessary checksums from the config file + checksums sync add checksums to the config file and remove unnecessary + checksums init create an empty config file cache clear clear the cache version show bindown version diff --git a/cmd/bindown/checksums.go b/cmd/bindown/checksums.go index 2b2ec5d..f3fa301 100644 --- a/cmd/bindown/checksums.go +++ b/cmd/bindown/checksums.go @@ -7,6 +7,7 @@ import ( type checksumsCmd struct { Add addChecksumsCmd `kong:"cmd,help=${add_checksums_help}"` Prune pruneChecksumsCmd `kong:"cmd,help=${prune_checksums_help}"` + Sync syncChecksumsCmd `kong:"cmd,help=${sync_checksums_help}"` } type addChecksumsCmd struct { @@ -39,3 +40,21 @@ func (d *pruneChecksumsCmd) Run(ctx *runContext) error { } return config.WriteFile(ctx.rootCmd.JSONConfig) } + +type syncChecksumsCmd struct{} + +func (d *syncChecksumsCmd) Run(ctx *runContext) error { + config, err := loadConfigFile(ctx, true) + if err != nil { + return err + } + err = config.PruneChecksums() + if err != nil { + return err + } + err = config.AddChecksums(nil, nil) + if err != nil { + return err + } + return config.WriteFile(ctx.rootCmd.JSONConfig) +} diff --git a/cmd/bindown/cli.go b/cmd/bindown/cli.go index 97f19ad..31928ce 100644 --- a/cmd/bindown/cli.go +++ b/cmd/bindown/cli.go @@ -21,6 +21,7 @@ var kongVars = kong.Vars{ "systems_help": `target systems in the format of /`, "add_checksums_help": `add checksums to the config file`, "prune_checksums_help": `remove unnecessary checksums from the config file`, + "sync_checksums_help": `add checksums to the config file and remove unnecessary checksums`, "config_format_help": `formats the config file`, "config_validate_help": `validate that installs work`, "config_install_completions_help": `install shell completions`, diff --git a/docs/clihelp.txt b/docs/clihelp.txt index 0c0af61..186dc68 100644 --- a/docs/clihelp.txt +++ b/docs/clihelp.txt @@ -35,6 +35,8 @@ Commands: supported-system remove remove a supported system checksums add add checksums to the config file checksums prune remove unnecessary checksums from the config file + checksums sync add checksums to the config file and remove unnecessary + checksums init create an empty config file cache clear clear the cache version show bindown version diff --git a/script/release b/script/release index c2535a7..e394ad0 100755 --- a/script/release +++ b/script/release @@ -63,13 +63,17 @@ else fi fi +# pre-build so there isn't such a long time between creating the release and adding the assets +if [ -f ".goreleaser.yaml" ]; then + script/bindown -q install goreleaser + bin/goreleaser release --snapshot --clean +fi + bin/gh release create "v$NEXT_VERSION" -t "v$NEXT_VERSION" --generate-notes # If there's no .goreleaser.yaml, there's nothing left to do. [ -f ".goreleaser.yaml" ] || exit 0 +# now build for real git fetch --tags - -script/bindown -q install goreleaser - bin/goreleaser release --clean