Skip to content

Commit

Permalink
Use parameter quoting for Paket helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 22, 2015
1 parent 2c1faf9 commit 7059887
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#### 3.24.0 - 22.03.2015
* BREAKING CHANGE: Better support for AssemblyMetadata in AssemblyInfoHelper - https://github.com/fsharp/FAKE/pull/694
* Added modules for building VB6 projects with SxS manifest - https://github.com/fsharp/FAKE/pull/697
* Use parameter quoting for Paket helpers

#### 3.23.0 - 12.03.2015
* BREAKING CHANGE: Adjusted Xamarin.iOS archive helper params - https://github.com/fsharp/FAKE/pull/693
Expand Down
12 changes: 6 additions & 6 deletions src/app/FakeLib/PaketHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ let Pack setParams =
if String.IsNullOrWhiteSpace notEncodedText then ""
else XText(notEncodedText).ToString().Replace("ß", "ß")

let version = if String.IsNullOrWhiteSpace parameters.Version then "" else sprintf " version \"%s\"" parameters.Version
let releaseNotes = if String.IsNullOrWhiteSpace parameters.ReleaseNotes then "" else sprintf " releaseNotes \"%s\"" (xmlEncode parameters.ReleaseNotes)
let version = if String.IsNullOrWhiteSpace parameters.Version then "" else " version " + toParam parameters.Version
let releaseNotes = if String.IsNullOrWhiteSpace parameters.ReleaseNotes then "" else " releaseNotes " + toParam (xmlEncode parameters.ReleaseNotes)

let packResult =
ExecProcess
Expand All @@ -74,15 +74,15 @@ let Push setParams =
let parameters : PaketPushParams = PaketPushDefaults() |> setParams

let packages = !! (parameters.WorkingDir @@ "/**/*.nupkg") |> Seq.toList
let url = if String.IsNullOrWhiteSpace parameters.PublishUrl then "" else sprintf " url \"%s\"" parameters.PublishUrl
let endpoint = if String.IsNullOrWhiteSpace parameters.EndPoint then "" else sprintf " endpoint \"%s\"" parameters.EndPoint
let key = if String.IsNullOrWhiteSpace parameters.ApiKey then "" else sprintf " apikey \"%s\"" parameters.ApiKey
let url = if String.IsNullOrWhiteSpace parameters.PublishUrl then "" else " url " + toParam parameters.PublishUrl
let endpoint = if String.IsNullOrWhiteSpace parameters.EndPoint then "" else " endpoint " + toParam parameters.EndPoint
let key = if String.IsNullOrWhiteSpace parameters.ApiKey then "" else " apikey " + toParam parameters.ApiKey

traceStartTask "PaketPush" (separated ", " packages)
for package in packages do
let pushResult =
ExecProcess (fun info ->
info.FileName <- parameters.ToolPath
info.Arguments <- sprintf "push %s%s%s file \"%s\"" url endpoint key package) System.TimeSpan.MaxValue
info.Arguments <- sprintf "push %s%s%s file %s" url endpoint key (toParam package)) System.TimeSpan.MaxValue
if pushResult <> 0 then failwithf "Error during pushing %s." package
traceEndTask "PaketPush" (separated ", " packages)
2 changes: 1 addition & 1 deletion src/app/FakeLib/ProcessHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ let StartRemoteService host serviceName =

/// Adds quotes around the string
/// [omit]
let quote str = "\"" + str + "\""
let quote (str:string) = "\"" + str.Replace("\"","\\\"") + "\""

/// Adds quotes around the string if needed
/// [omit]
Expand Down

0 comments on commit 7059887

Please sign in to comment.