diff --git a/tools/gomod-required-updater/README.md b/tools/gomod-local-update/README.md similarity index 89% rename from tools/gomod-required-updater/README.md rename to tools/gomod-local-update/README.md index 6549555e22f..23fa22e6314 100644 --- a/tools/gomod-required-updater/README.md +++ b/tools/gomod-local-update/README.md @@ -1,4 +1,4 @@ -# gomod-required-updater +# gomod-local-update Updates required module versions in go.mod files to match the latest git SHA from a remote branch. @@ -21,7 +21,7 @@ Optional: The installed binary will be placed in your `$GOPATH/bin` directory. Make sure this directory is in your system's PATH to run the command from anywhere. From the root of this repository, run: ```shell -go install ./tools/gomod-required-updater/cmd/gomod-required-updater +go install ./tools/gomod-local-update/cmd/gomod-local-update ``` ## Usage Examples diff --git a/tools/gomod-required-updater/cmd/gomod-required-updater/main.go b/tools/gomod-local-update/cmd/gomod-local-update/main.go similarity index 61% rename from tools/gomod-required-updater/cmd/gomod-required-updater/main.go rename to tools/gomod-local-update/cmd/gomod-local-update/main.go index acb01779ee9..284c6a7e932 100644 --- a/tools/gomod-required-updater/cmd/gomod-required-updater/main.go +++ b/tools/gomod-local-update/cmd/gomod-local-update/main.go @@ -5,16 +5,19 @@ import ( "log" "os" - "github.com/smartcontractkit/chainlink/v2/tools/gomod-required-updater/internal/updater" + "github.com/smartcontractkit/chainlink/v2/tools/gomod-local-update/internal/updater" ) +const ( + goBinaryName = "gomod-local-update" +) var version = "dev" -var usage = `gomod-required-updater version %s +var usage = fmt.Sprintf(`%s version %%s Usage: cd /path/to/go/module - gomod-required-updater [flags] -` + %s [flags] +`, goBinaryName, goBinaryName) func main() { cfg, err := updater.ParseFlags(os.Args[1:], version) @@ -24,7 +27,7 @@ func main() { } if cfg.ShowVersion { - fmt.Printf("gomod-required-updater version %s\n", version) + fmt.Printf("%s version %s\n", goBinaryName, version) os.Exit(0) } diff --git a/tools/gomod-required-updater/internal/updater/config.go b/tools/gomod-local-update/internal/updater/config.go similarity index 95% rename from tools/gomod-required-updater/internal/updater/config.go rename to tools/gomod-local-update/internal/updater/config.go index ee14e9488a5..9173e2b2148 100644 --- a/tools/gomod-required-updater/internal/updater/config.go +++ b/tools/gomod-local-update/internal/updater/config.go @@ -23,7 +23,7 @@ type Config struct { } func ParseFlags(args []string, version string) (*Config, error) { - flags := flag.NewFlagSet("gomod-required-updater", flag.ContinueOnError) + flags := flag.NewFlagSet("default", flag.ContinueOnError) cfg := &Config{ ModulesToUpdate: make([]string, 0), diff --git a/tools/gomod-required-updater/internal/updater/config_test.go b/tools/gomod-local-update/internal/updater/config_test.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/config_test.go rename to tools/gomod-local-update/internal/updater/config_test.go diff --git a/tools/gomod-required-updater/internal/updater/interfaces.go b/tools/gomod-local-update/internal/updater/interfaces.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/interfaces.go rename to tools/gomod-local-update/internal/updater/interfaces.go diff --git a/tools/gomod-required-updater/internal/updater/module_operator.go b/tools/gomod-local-update/internal/updater/module_operator.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/module_operator.go rename to tools/gomod-local-update/internal/updater/module_operator.go diff --git a/tools/gomod-required-updater/internal/updater/system_operator.go b/tools/gomod-local-update/internal/updater/system_operator.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/system_operator.go rename to tools/gomod-local-update/internal/updater/system_operator.go diff --git a/tools/gomod-required-updater/internal/updater/updater.go b/tools/gomod-local-update/internal/updater/updater.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/updater.go rename to tools/gomod-local-update/internal/updater/updater.go diff --git a/tools/gomod-required-updater/internal/updater/updater_test.go b/tools/gomod-local-update/internal/updater/updater_test.go similarity index 100% rename from tools/gomod-required-updater/internal/updater/updater_test.go rename to tools/gomod-local-update/internal/updater/updater_test.go