Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(strm.yaml): configuration directory wasn't set yet #46

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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