Skip to content

Commit

Permalink
fix: enables double quotes in env (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshwata authored Jan 24, 2022
1 parent e7200ff commit 1bfab7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion screwdriver/screwdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
)

var regexpForUnmarshal = regexp.MustCompile(`"(.*?)" *: *"(.*?)"`)
var regexpForUnmarshal = regexp.MustCompile(`"(.*?)" *: *"((.*?(\\\")?)+)"`)

const (
apiVersion = "v4"
Expand Down
4 changes: 4 additions & 0 deletions screwdriver/screwdriver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func TestJob(t *testing.T) {
"TEST_ENV",
"hoge",
},
{
"ESCAPED_COMMAND",
"-c \\\"echo FOO\\\"",
},
},
Image: "alpine",
}
Expand Down
3 changes: 2 additions & 1 deletion screwdriver/testdata/validatedSuccess.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
}
],
"environment": {
"TEST_ENV": "hoge"
"TEST_ENV": "hoge",
"ESCAPED_COMMAND": "-c \"echo FOO\""
},
"image": "alpine"
}
Expand Down

0 comments on commit 1bfab7e

Please sign in to comment.