Skip to content

Commit

Permalink
Proper escaping, fixes #3093
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Feb 28, 2018
1 parent b2524e3 commit e08672c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Paket.Core/Installation/ScriptGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ module ScriptGeneration =
else libFile.FullName

// create the approiate load string for the target resource
let refString (reference:ReferenceType) =
let refString (reference:ReferenceType) =
let escapeString (s:string) =
s.Replace("\\", "\\\\").Replace("\"", "\\\"")
match reference, self.Lang with
| Assembly file, _ ->
sprintf """#r "%s" """ (relativePath scriptFile file)
| LoadScript script, ScriptType.FSharp ->
sprintf """#load @"%s" """ (relativePath scriptFile ((baseDirectory.FullName </> script) |> FileInfo))
| LoadScript script, ScriptType.CSharp ->
sprintf """#load "%s" """ (relativePath scriptFile ((baseDirectory.FullName </> script) |> FileInfo))
sprintf """#r "%s" """ (relativePath scriptFile file |> escapeString)
| LoadScript script, _ ->
sprintf """#load "%s" """ (relativePath scriptFile ((baseDirectory.FullName </> script) |> FileInfo) |> escapeString)
| Framework name,_ ->
sprintf """#r "%s" """ name
sprintf """#r "%s" """ (escapeString name)

self.Input |> Seq.map refString |> Seq.distinct |> String.concat "\n"

Expand Down

0 comments on commit e08672c

Please sign in to comment.