Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip ? if it's leading query string #28

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ paket add Fable.Elmish.UrlParser

## Building

With .NET Core SDK v6 and fake tool:
With .NET Core SDK v6:
> `fotnet fsi build.fsx`
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.2
* Skip query's "?" (#25)

## 1.0.1
* Support empty params query

Expand Down
30 changes: 4 additions & 26 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env -S dotnet fsi
#r "nuget: Fake.Core.Target"
#r "nuget: Fake.IO.FileSystem"
#r "nuget: Fake.DotNet.Cli"
#r "nuget: Fake.Core.Target"
Expand Down Expand Up @@ -34,8 +33,6 @@ System.Environment.GetCommandLineArgs()
|> Context.RuntimeContext.Fake
|> Context.setExecutionContext

let withWorkDir = DotNet.Options.withWorkingDirectory

Target.create "Clean" (fun _ ->
Shell.cleanDir "src/obj"
Shell.cleanDir "src/bin"
Expand All @@ -45,23 +42,12 @@ Target.create "Clean" (fun _ ->

Target.create "Restore" (fun _ ->
projects
|> Seq.iter (fun s ->
let dir = Path.GetDirectoryName s
DotNet.restore (fun a -> a.WithCommon (withWorkDir dir)) s
)
|> Seq.iter (Path.GetDirectoryName >> DotNet.restore id)
)

Target.create "Build" (fun _ ->
projects
|> Seq.iter (fun s ->
let dir = Path.GetDirectoryName s
DotNet.build (fun a ->
a.WithCommon
(fun c ->
let c = c |> withWorkDir dir
{c with CustomParams = Some "/p:SourceLinkCreate=true"}))
s
)
|> Seq.iter (Path.GetDirectoryName >> DotNet.build id)
)

Target.create "Test" (fun _ ->
Expand Down Expand Up @@ -92,19 +78,11 @@ Target.create "Meta" (fun _ ->

Target.create "Package" (fun _ ->
projects
|> Seq.iter (fun s ->
let dir = Path.GetDirectoryName s
DotNet.pack (fun a ->
a.WithCommon (withWorkDir dir)
) s
)
|> Seq.iter (Path.GetDirectoryName >> DotNet.pack id)
)

Target.create "PublishNuget" (fun _ ->
let exec dir =
DotNet.exec (fun a ->
a.WithCommon (withWorkDir dir)
)
let exec dir = DotNet.exec (DotNet.Options.withWorkingDirectory dir)

let args = sprintf "push Fable.Elmish.UrlParser.%s.nupkg -s nuget.org -k %s" (string release.SemVer) (Environment.environVar "nugetkey")
let result = exec "src/bin/Release" "nuget" args
Expand Down
3 changes: 2 additions & 1 deletion src/parser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ let internal toKeyValuePair (segment: string) =
let parseParams (querystring: string) =
if System.String.IsNullOrEmpty querystring then Map.empty
else
querystring.Split('&')
let querystring' = if querystring.StartsWith("?") then querystring.Substring(1) else querystring
querystring'.Split('&')
|> Seq.map toKeyValuePair
|> Seq.choose id
|> Map.ofSeq
Expand Down
Loading