Skip to content

Commit b430629

Browse files
committed
lookup single project correctly
1 parent aec7da4 commit b430629

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/sourcemaps/upload.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
"github.com/launchdarkly/ldcli/cmd/cliflags"
2020
resourcescmd "github.com/launchdarkly/ldcli/cmd/resources"
21+
"github.com/launchdarkly/ldcli/cmd/validators"
2122
"github.com/launchdarkly/ldcli/internal/output"
2223
"github.com/launchdarkly/ldcli/internal/resources"
2324
)
@@ -72,6 +73,7 @@ type SourceMapFile struct {
7273

7374
func NewUploadCmd(client resources.Client) *cobra.Command {
7475
cmd := &cobra.Command{
76+
Args: validators.Validate(),
7577
Use: "upload",
7678
Short: "Upload sourcemaps",
7779
Long: "Upload JavaScript sourcemaps to LaunchDarkly for error monitoring",
@@ -133,6 +135,9 @@ func runE(client resources.Client) func(cmd *cobra.Command, args []string) error
133135
if err = json.Unmarshal(res, &projectResult); err != nil {
134136
return output.NewCmdOutputError(err, viper.GetString(cliflags.OutputFlag))
135137
}
138+
if projectResult.ID == "" {
139+
return fmt.Errorf("project %s not found", projectKey)
140+
}
136141

137142
appVersion := viper.GetString(appVersionFlag)
138143
path := viper.GetString(pathFlag)

0 commit comments

Comments
 (0)