Skip to content

Instantly share code, notes, and snippets.

@vbfox
Created August 21, 2014 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vbfox/6b3eb163a9beac1ba912 to your computer and use it in GitHub Desktop.
Save vbfox/6b3eb163a9beac1ba912 to your computer and use it in GitHub Desktop.
FAKE: Escape special team city comments
let private teamCityEscapeChars =
[ ('\'', "|'"); ('\r', "|r"); ('\n', "|n"); ('|', "||"); ('[', "|["); (']', "|]") ]
|> Map.ofSeq
let private teamCityEscape s =
let final = s |> Seq.map (fun c ->
match teamCityEscapeChars |> Map.tryFind c with
| Some(replacement) -> replacement
| _ -> string(c)
)
String.Join("", final)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment