File tree Expand file tree Collapse file tree 4 files changed +34
-5
lines changed
Expand file tree Collapse file tree 4 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,16 @@ module MSBuild =
2727 | Project of string
2828
2929 let sprintfMsbuildArg a =
30- //TODO quote
30+ let quote ( s : string ) =
31+ if s.Contains( " " )
32+ then sprintf " \" %s \" " s
33+ else s
34+
3135 match a with
32- | Property ( k, v) -> sprintf " /p:%s =%s " k v
33- | Target t -> sprintf " /t:%s " t
36+ | Property ( k, v) -> sprintf " /p:%s =%s " k v |> quote
37+ | Target t -> sprintf " /t:%s " t |> quote
3438 | Switch w -> sprintf " /%s " w
35- | Project w -> w
39+ | Project w -> w |> quote
3640
3741open MSBuild
3842
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ open System.IO
5050
5151let runCmd log exePath args =
5252 log ( sprintf " running '%s %s '" exePath ( args |> String.concat " " ))
53- let cmd = Command.Run( exePath, args |> Array.ofList |> Array.map box)
53+ let cmd = Command.Run( exePath, args |> List.map ( fun s -> s.Trim ( '"' )) |> Array.ofList |> Array.map box)
5454
5555 let result = cmd.Result
5656 log " output:"
Original file line number Diff line number Diff line change 1+ // Learn more about F# at http://fsharp.org
2+
3+ open System
4+
5+ [<EntryPoint>]
6+ let main argv =
7+ printfn " Hello World from F#!"
8+ 0 // return an integer exit code
Original file line number Diff line number Diff line change 1+ <Project Sdk =" FSharp.NET.Sdk;Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFramework >netcoreapp1.1</TargetFramework >
6+ </PropertyGroup >
7+
8+ <ItemGroup >
9+ <Compile Include =" Program.fs" />
10+ </ItemGroup >
11+
12+ <ItemGroup >
13+ <PackageReference Include =" FSharp.Core" Version =" 4.1.*" />
14+ <PackageReference Include =" FSharp.NET.Sdk" Version =" 1.0.*" PrivateAssets =" All" />
15+ </ItemGroup >
16+
17+ </Project >
You can’t perform that action at this time.
0 commit comments