Skip to content

Commit

Permalink
fix comma separated list of app ids
Browse files Browse the repository at this point in the history
  • Loading branch information
taraspos committed Dec 11, 2024
1 parent 3b0aac0 commit d1d9e50
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/amplify-preview/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"log/slog"
"os"
"strings"

"github.com/alecthomas/kingpin/v2"
"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -40,7 +41,6 @@ var (
)

func main() {

kingpin.Parse()
ctx := context.Background()

Expand All @@ -54,7 +54,14 @@ func main() {

amp := AmplifyPreview{
client: amplify.NewFromConfig(cfg),
appIDs: *amplifyAppIDs,
appIDs: func() []string {
if len(*amplifyAppIDs) == 1 {
// kingpin env variables are separated by new lines, and there is no way to change the behavior
// https://github.com/alecthomas/kingpin/issues/249
return strings.Split((*amplifyAppIDs)[0], ",")
}
return *amplifyAppIDs
}(),
}

// Check if Amplify branch is already connected to one of the Amplify Apps
Expand Down

0 comments on commit d1d9e50

Please sign in to comment.