Skip to content
Open
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
13 changes: 7 additions & 6 deletions cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,16 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command
sepSpecificationFiles := strings.Split(specificationFiles, ",")
for _, f := range sepSpecificationFiles {
mainArtifact := true
var err error

// Check if mainArtifact flag is provided.
if strings.Contains(f, ":") {
pathAndMainArtifact := strings.Split(f, ":")
f = pathAndMainArtifact[0]
mainArtifact, err = strconv.ParseBool(pathAndMainArtifact[1])
if err != nil {
fmt.Printf("Cannot parse '%s' as Bool, default to true\n", pathAndMainArtifact[1])
lastColon := strings.LastIndex(f, ":")
boolPart := f[lastColon+1:]
f = f[:lastColon]
if val, parseErr := strconv.ParseBool(boolPart); parseErr != nil {
fmt.Printf("Cannot parse '%s' as Bool, default to true\n", boolPart)
} else {
mainArtifact = val
}
}
Comment on lines 124 to 133

Expand Down
5 changes: 3 additions & 2 deletions cmd/importURL.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ func NewImportURLCommand(globalClientOpts *connectors.ClientOptions) *cobra.Comm
if n > 2 {
val, err := strconv.ParseBool(urlAndMainAtrifactAndSecretName[2])
if err != nil {
fmt.Println(err)
fmt.Printf("Cannot parse '%s' as Bool, default to true\n", urlAndMainAtrifactAndSecretName[2])
} else {
mainArtifact = val
}
Comment on lines 109 to 114
mainArtifact = val
}
if n > 3 {
secret = urlAndMainAtrifactAndSecretName[3]
Expand Down