mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-19 19:17:01 -07:00
cmd: minor changes
This commit is contained in:
parent
6bf75e27ce
commit
4f836630b0
2 changed files with 4 additions and 3 deletions
|
|
@ -81,6 +81,7 @@ var generateCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the client options
|
// set the client options
|
||||||
|
// params.ClientOpts = append(params.ClientOpts, client.WithHost(remoteHost))
|
||||||
if conf.AccessToken != "" {
|
if conf.AccessToken != "" {
|
||||||
params.ClientOpts = append(params.ClientOpts, client.WithAccessToken(conf.AccessToken))
|
params.ClientOpts = append(params.ClientOpts, client.WithAccessToken(conf.AccessToken))
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +90,7 @@ var generateCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
// run generator.Generate() with just plugin path and templates provided
|
// run generator.Generate() with just plugin path and templates provided
|
||||||
outputBytes, err := generator.Generate(pluginPath, params)
|
outputBytes, err := generator.Generate(&conf, pluginPath, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("failed to generate files")
|
log.Error().Err(err).Msg("failed to generate files")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,13 @@ func Execute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cobra.OnInitialize(initConfig)
|
cobra.OnInitialize(InitConfig)
|
||||||
rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "set the config path")
|
rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "set the config path")
|
||||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "set to enable verbose output")
|
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "set to enable verbose output")
|
||||||
rootCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "path to CA cert. (defaults to system CAs)")
|
rootCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "path to CA cert. (defaults to system CAs)")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initConfig() {
|
func InitConfig() {
|
||||||
// empty from not being set
|
// empty from not being set
|
||||||
if configPath != "" {
|
if configPath != "" {
|
||||||
exists, err := util.PathExists(configPath)
|
exists, err := util.PathExists(configPath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue