Skip to content

Commit

Permalink
fix: branch check
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak committed Sep 20, 2024
1 parent 9b4fb7f commit 1f66e6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/workspace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func getTarget(targetList []apiclient.ProviderTarget, activeProfileName string)
}

func processPrompting(apiClient *apiclient.APIClient, workspaceName *string, projects *[]apiclient.CreateProjectDTO, workspaceNames []string, ctx context.Context) error {
if workspace_util.CheckAnyProjectConfigurationFlagSet(projectConfigurationFlags) {
if workspace_util.CheckAnyProjectConfigurationFlagSet(projectConfigurationFlags) || (projectConfigurationFlags.Branches != nil && len(*projectConfigurationFlags.Branches) > 0) {
return errors.New("please provide the repository URL in order to set up custom project details through the CLI")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/workspace/util/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func AddProjectConfigurationFlags(cmd *cobra.Command, flags ProjectConfiguration
}

func CheckAnyProjectConfigurationFlagSet(flags ProjectConfigurationFlags) bool {
return *flags.CustomImage != "" || *flags.CustomImageUser != "" || (flags.Branches != nil && len(*flags.Branches) > 0) || *flags.DevcontainerPath != "" || *flags.Builder != "" || len(*flags.EnvVars) > 0
return *flags.CustomImage != "" || *flags.CustomImageUser != "" || *flags.DevcontainerPath != "" || *flags.Builder != "" || len(*flags.EnvVars) > 0
}

func IsProjectRunning(workspace *apiclient.WorkspaceDTO, projectName string) bool {
Expand Down

0 comments on commit 1f66e6a

Please sign in to comment.