Skip to content

Commit

Permalink
Allow $ver placeholder in URL names (#125)
Browse files Browse the repository at this point in the history
Just like the $ver placeholder is supported for the URL itself.

Signed-off-by: Tom Wieczorek <tom@bibbu.net>
  • Loading branch information
twz123 authored Nov 21, 2024
1 parent fa76099 commit 6a3f54d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ How do we fetch the package source if we have the target version number?
- `fetch.docker = owner/name`

Optional config for `nix-prefetch-url`, applies when the fetcher equals to `fetch.url`.
`$ver` is available in string, just like for the fetch config.

- `url.name = file_name`

Expand Down
2 changes: 1 addition & 1 deletion app/Config/PackageFetcher.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ urlDecoder :: Decoder PackageFetcher
urlDecoder = do
url <- getFields ["fetch", "url"]
name <- getFieldsOpt ["url", "name"]
pure $ \(coerce -> v) -> urlFetcher' (T.replace "$ver" v url) name
pure $ \(coerce -> v) -> urlFetcher' (T.replace "$ver" v url) (fmap (T.replace "$ver" v) name)

--------------------------------------------------------------------------------

Expand Down

0 comments on commit 6a3f54d

Please sign in to comment.