diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 11602cf..6b78f02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ pages: before_script: - apt-get update && apt-get install -y hugo script: - - ./signaldctl doc + - SIGNALDCTL_PUBLIC_DOC_MODE=on ./signaldctl doc - cd docs - hugo - mv public ../ diff --git a/cmd/signaldctl/cmd/root.go b/cmd/signaldctl/cmd/root.go index 54c916d..05b38dd 100644 --- a/cmd/signaldctl/cmd/root.go +++ b/cmd/signaldctl/cmd/root.go @@ -66,7 +66,11 @@ func Execute() { func init() { cobra.OnInitialize(initConfig) - RootCmd.PersistentFlags().StringVar(&config.Path, "config", fmt.Sprintf("%s/.config/signaldctl.yaml", os.Getenv("HOME")), "config file (default is ~/.config/signaldctl.yaml)") + defaultConfigPath := fmt.Sprintf("%s/.config/signaldctl.yaml", os.Getenv("HOME")) + if os.Getenv("SIGNALDCTL_PUBLIC_DOC_MODE") == "on" { + defaultConfigPath = "~/.config/signaldctl.yaml" + } + RootCmd.PersistentFlags().StringVar(&config.Path, "config", defaultConfigPath, "config file") RootCmd.PersistentFlags().StringVar(&socketPath, "socket", "/var/run/signald/signald.sock", "the path to the signald socket file") RootCmd.PersistentFlags().StringVarP(&common.OutputFormat, "output-format", "o", "default", "the output format. options are usually table, yaml and json, default is usually table. Some commands have other options.") RootCmd.AddCommand(account.AccountCmd)