Skip to content

Commit

Permalink
Don't use </> for URL construction. (#104)
Browse files Browse the repository at this point in the history
As pointed out by #87.  (However, Windows support is still not yet tested.)
  • Loading branch information
judah authored Aug 31, 2018
1 parent db12ab9 commit 8eb3421
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Pier/Build/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ downloadCabalPackage pkg = do
askDownload Download
{ downloadFilePrefix = "hackage"
, downloadName = n <.> "tar.gz"
, downloadUrlPrefix = "https://hackage.haskell.org/package" </> n
, downloadUrlPrefix = "https://hackage.haskell.org/package/" ++ n
}

getPackageSourceDir :: PackageIdentifier -> Action Artifact
Expand Down
6 changes: 3 additions & 3 deletions src/Pier/Core/Download.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import Pier.Core.Directory
import Pier.Core.Persistent
import Pier.Core.Run

-- | Downloads @downloadUrlPrefix </> downloadName@ to
-- @downloadFilePrefix </> downloadName@.
-- | Downloads @downloadUrlPrefix / downloadName@ to
-- @downloadFilePrefix / downloadName@.
-- Everything is stored in `~/.pier/downloads`.
data Download = Download
{ downloadUrlPrefix :: String
Expand Down Expand Up @@ -66,7 +66,7 @@ downloadRules loc = do
(createPierTempFile $ takeFileName $ downloadName d)
Directory.removeFile
$ \tmp -> do
let url = downloadUrlPrefix d </> downloadName d
let url = downloadUrlPrefix d ++ "/" ++ downloadName d
req <- parseRequest url
resp <- httpLbs req manager
unless (statusIsSuccessful . responseStatus $ resp)
Expand Down

0 comments on commit 8eb3421

Please sign in to comment.