Skip to content

Commit

Permalink
fix(strm.yaml): configuration directory wasn't set yet (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvdeenen authored Aug 19, 2021
1 parent a889b21 commit 4023657
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/strm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
var configPath string

const (
apiHostFlag = "api-host"
apiHostFlag = "api-host"

// The environment variable prefix of all environment variables bound to our command line flags.
// For example, --api-host is bound to STRM_API_HOST
Expand All @@ -48,6 +48,7 @@ var RootCmd = &cobra.Command{
Use: common.RootCommandName,
Short: fmt.Sprintf("Stream Machine CLI %s", cmd.Version),
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
constants.ConfigPath = configPath
util.CreateConfigDirAndFileIfNotExists()
err := initializeConfig(cmd)

Expand All @@ -60,7 +61,6 @@ var RootCmd = &cobra.Command{
}
})

constants.ConfigPath = configPath
auth.SetupClient(util.GetStringAndErr(cmd.Flags(), auth.ApiAuthUrlFlag))

var billingId = ""
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"streammachine.io/strm/pkg/entity/usage"
)


var GetCmd = &cobra.Command{
Use: constants.GetCommandName,
Short: "Get an entity",
Expand Down
6 changes: 2 additions & 4 deletions pkg/context/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func Configuration() *cobra.Command {
constants.OutputFormatFlag,
constants.OutputFormatFlagShort,
constants.OutputFormatPlain,
fmt.Sprintf("Configuration output format [%v]", constants.ConfigOutputFormatFlagAllowedValues,
),
fmt.Sprintf("Configuration output format [%v]", constants.ConfigOutputFormatFlagAllowedValues),
)
err := configuration.RegisterFlagCompletionFunc(constants.OutputFormatFlag, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return constants.ConfigOutputFormatFlagAllowedValues, cobra.ShellCompDirectiveNoFileComp
Expand Down Expand Up @@ -59,8 +58,7 @@ func EntityInfo() *cobra.Command {
constants.OutputFormatFlag,
constants.OutputFormatFlagShort,
constants.OutputFormatFilepath,
fmt.Sprintf("Entity information output format [%v]", constants.ContextOutputFormatFlagAllowedValues,
),
fmt.Sprintf("Entity information output format [%v]", constants.ContextOutputFormatFlagAllowedValues),
)
err := entityInfo.RegisterFlagCompletionFunc(constants.OutputFormatFlag, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return constants.ContextOutputFormatFlagAllowedValues, cobra.ShellCompDirectiveNoFileComp
Expand Down

0 comments on commit 4023657

Please sign in to comment.