From 04c99807b518cb03a64d7ba7884332b42172e6a5 Mon Sep 17 00:00:00 2001 From: PatrickMenoti <82882574+PatrickMenoti@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:30:31 -0300 Subject: [PATCH] fix: corrent prefix when uploading files #patch --- pkg/api/s3/upload.go | 3 ++- pkg/cmd/init/init.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/api/s3/upload.go b/pkg/api/s3/upload.go index 8bf0cd00..4cd38572 100644 --- a/pkg/api/s3/upload.go +++ b/pkg/api/s3/upload.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "path" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" @@ -55,7 +56,7 @@ func New(s3AccessKey, s3SecretKey string) (aws.Config, error) { func UploadFile(ctx context.Context, cfg aws.Config, fileOps *contracts.FileOps, bucketName, prefix string) error { file := fileOps.Path if prefix != "" { - file = fmt.Sprintf("%s%s", prefix, fileOps.Path) + file = path.Join(prefix, fileOps.Path) } s3Client := s3.NewFromConfig(cfg) diff --git a/pkg/cmd/init/init.go b/pkg/cmd/init/init.go index 4f7d2644..464d0f0d 100644 --- a/pkg/cmd/init/init.go +++ b/pkg/cmd/init/init.go @@ -330,7 +330,7 @@ func (cmd *initCmd) Run(c *cobra.Command, _ []string) error { func (cmd *initCmd) deps(c *cobra.Command, m string, msgs *[]string) error { if !c.Flags().Changed("package-manager") { - if !utils.Confirm(cmd.globalFlagAll, m, true) { + if !utils.Confirm(cmd.globalFlagAll, m, false) { return nil }