From 399d3fbd0f55a695a1a2e4de13e77104d523818a Mon Sep 17 00:00:00 2001 From: Shawn Yu Date: Mon, 13 May 2024 16:13:45 -0400 Subject: [PATCH] fix: set hostname --- cmd/config/config.go | 1 + config/config.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/config/config.go b/cmd/config/config.go index 21beba0..2376766 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -36,4 +36,5 @@ var configCmd = &cobra.Command{ func init() { cmd.RootCmd.AddCommand(configCmd) configCmd.Flags().StringVar(&flags.hostName, "hostname", "", "set the hostname") + configCmd.MarkFlagRequired("hostname") } diff --git a/config/config.go b/config/config.go index 9fb10cb..5895bc2 100644 --- a/config/config.go +++ b/config/config.go @@ -40,8 +40,8 @@ func Write(config Config) error { if err != nil { log.Fatal(err) } - os.Mkdir(homeDir+"/.config/gh-ac-go/", 0777) + os.Mkdir(homeDir+"/.config/gh-ac/", 0777) - err = viper.WriteConfigAs(homeDir + "/.config/gh-ac-go/default-config.yml") + err = viper.WriteConfigAs(homeDir + "/.config/gh-ac/default-config.yml") return err }