Skip to content

Commit

Permalink
chore: no quote for list
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Aug 18, 2024
1 parent e8027a1 commit 622c7f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion atlasexec/atlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,5 +821,5 @@ func (e *InvalidParamsError) Error() string {
}

func listString(args []string) string {
return strconv.Quote(strings.Join(args, ","))
return strings.Join(args, ",")
}
9 changes: 4 additions & 5 deletions atlasexec/atlas_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package atlasexec
import (
"context"
"encoding/json"
"strings"
)

type (
Expand Down Expand Up @@ -145,10 +144,10 @@ func (c *Client) SchemaApplySlice(ctx context.Context, params *SchemaApplyParams
args = append(args, "--dev-url", params.DevURL)
}
if len(params.Schema) > 0 {
args = append(args, "--schema", strings.Join(params.Schema, ","))
args = append(args, "--schema", listString(params.Schema))
}
if len(params.Exclude) > 0 {
args = append(args, "--exclude", strings.Join(params.Exclude, ","))
args = append(args, "--exclude", listString(params.Exclude))
}
if params.Vars != nil {
args = append(args, params.Vars.AsArgs()...)
Expand Down Expand Up @@ -178,10 +177,10 @@ func (c *Client) SchemaInspect(ctx context.Context, params *SchemaInspectParams)
args = append(args, "--format", params.Format)
}
if len(params.Schema) > 0 {
args = append(args, "--schema", strings.Join(params.Schema, ","))
args = append(args, "--schema", listString(params.Schema))
}
if len(params.Exclude) > 0 {
args = append(args, "--exclude", strings.Join(params.Exclude, ","))
args = append(args, "--exclude", listString(params.Exclude))
}
if params.Vars != nil {
args = append(args, params.Vars.AsArgs()...)
Expand Down
2 changes: 1 addition & 1 deletion atlasexec/atlas_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestSchemaPlan(t *testing.T) {
From: []string{"1", "2"},
To: []string{"2", "3"},
},
expect: `schema plan --from "1,2" --to "2,3" --auto-approve`,
expect: `schema plan --from 1,2 --to 2,3 --auto-approve`,
},
{
name: "with config",
Expand Down

0 comments on commit 622c7f7

Please sign in to comment.