diff --git a/screwdriver/screwdriver.go b/screwdriver/screwdriver.go index 5da6015..a8a6dae 100644 --- a/screwdriver/screwdriver.go +++ b/screwdriver/screwdriver.go @@ -13,7 +13,7 @@ import ( "strings" ) -var regexpForUnmarshal = regexp.MustCompile(`"(.*?)" *: *"(.*?)"`) +var regexpForUnmarshal = regexp.MustCompile(`"(.*?)" *: *"((.*?(\\\")?)+)"`) const ( apiVersion = "v4" diff --git a/screwdriver/screwdriver_test.go b/screwdriver/screwdriver_test.go index 92af43d..2c66ac0 100644 --- a/screwdriver/screwdriver_test.go +++ b/screwdriver/screwdriver_test.go @@ -79,6 +79,10 @@ func TestJob(t *testing.T) { "TEST_ENV", "hoge", }, + { + "ESCAPED_COMMAND", + "-c \\\"echo FOO\\\"", + }, }, Image: "alpine", } diff --git a/screwdriver/testdata/validatedSuccess.json b/screwdriver/testdata/validatedSuccess.json index 42695f4..e05bad0 100644 --- a/screwdriver/testdata/validatedSuccess.json +++ b/screwdriver/testdata/validatedSuccess.json @@ -13,7 +13,8 @@ } ], "environment": { - "TEST_ENV": "hoge" + "TEST_ENV": "hoge", + "ESCAPED_COMMAND": "-c \"echo FOO\"" }, "image": "alpine" }