Skip to content

Commit

Permalink
fix: sam deploy --tags format
Browse files Browse the repository at this point in the history
  • Loading branch information
mokele committed Nov 2, 2020
1 parent 1eca6f1 commit 3ca42f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ const keyNameValueNameJoinedCommand = {
formatTag: (key, value) => `${key}=${value}`,
formatTags: tags => [tags.join(',')]
}
const keyNameValueNameKeyValueTags = {
formatParameter: (key, value) => `ParameterKey=${key},ParameterValue=${value}`,
formatParameters: identity,
formatTag: (key, value) => `${key}=${value}`,
formatTags: identity
}
const nameValue = {
formatParameter: (key, value) => `Name=${key},Value=${value}`,
formatParameters: identity,
formatTag: (key, value) => `Key=${key},Value=${value}`,
formatTags: identity
formatTags: tags => [tags.join(',')]
}

const helpCommands = {
Expand All @@ -57,7 +63,7 @@ const parameterTypes = {
}
},
sam: {
deploy: [parameterOverrides, keyNameValueName]
deploy: [parameterOverrides, keyNameValueNameKeyValueTags]
},
rain: {
deploy: [params, keyNameValueNameJoinedCommand]
Expand Down
7 changes: 3 additions & 4 deletions test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ Array [
"Name=key1,Value=value1",
"Name=key2,Value=value2",
"--tags",
"Key=tagKey1,Value=tagValue1",
"Key=tagKey2,Value=tagValue2",
"Key=tagKey1,Value=tagValue1,Key=tagKey2,Value=tagValue2",
]
`;

Expand Down Expand Up @@ -185,8 +184,8 @@ Array [
"ParameterKey=key1,ParameterValue=value1",
"ParameterKey=key2,ParameterValue=value2",
"--tags",
"Key=tagKey1,Value=tagValue1",
"Key=tagKey2,Value=tagValue2",
"tagKey1=tagValue1",
"tagKey2=tagValue2",
]
`;

Expand Down

0 comments on commit 3ca42f7

Please sign in to comment.