nixfromnpm 0.1.0.5 → 0.1.0.6
raw patch · 2 files changed
+10/−8 lines, 2 files
Files
- nixfromnpm.cabal +1/−1
- src/NixFromNpm/NpmLookup.hs +9/−7
nixfromnpm.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: nixfromnpm-version: 0.1.0.5+version: 0.1.0.6 synopsis: Generate nix expressions from npm packages. -- description: license: MIT
src/NixFromNpm/NpmLookup.hs view
@@ -177,9 +177,9 @@ -- | Fetch a package over HTTP. Return the version of the fetched package, -- and store the hash.-fetchHttp :: Text -- | Subpath in which to find the package.json.- -> URI -- | The URI to fetch.- -> NpmFetcher SemVer -- | The version of the package at that URI.+fetchHttp :: Text -- ^ Subpath in which to find the package.json.+ -> URI -- ^ The URI to fetch.+ -> NpmFetcher SemVer -- ^ The version of the package at that URI. fetchHttp subpath uri = do -- Use nix-fetch to download and hash the tarball. (hash, tarballPath) <- nixPrefetchSha1 uri@@ -218,10 +218,12 @@ Nothing -> putStrLn "" >> error "No default branch, or not a string" _ -> error "Expected an object back from github" -getShaOfBranch :: Name -- | Repo owner- -> Name -- | Repo name- -> Name -- | Name of the branch to get- -> NpmFetcher Text -- | The hash of the default branch+-- | Given a github repo and a branch, gets the SHA of the head of that+-- branch+getShaOfBranch :: Name -- ^ Repo owner+ -> Name -- ^ Repo name+ -> Name -- ^ Name of the branch to get+ -> NpmFetcher Text -- ^ The hash of the branch getShaOfBranch owner repo branchName = do let rpath = "/" <> owner <> "/" <> repo let uri = concat ["https://api.github.com/repos", rpath,