this repo has no description

feat: support tag fetching

+13 -2
+13 -2
fetcher.nix
··· 20 20 owner, 21 21 repo, 22 22 rev ? null, 23 - name ? repoRevToNameMaybe repo rev "tangled", 23 + tag ? null, 24 + name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled", 24 25 25 26 # fetchgit stuff 26 27 fetchSubmodules ? false, ··· 34 35 ... 35 36 }@args: 36 37 38 + assert lib.assertMsg (lib.xor (tag != null) ( 39 + rev != null 40 + )) "fetchFromTangled requires one of either `rev` or `tag` to be provided (not both)."; 41 + 37 42 let 38 43 39 44 position = ( 40 45 if args.meta.description or null != null then 41 46 builtins.unsafeGetAttrPos "description" args.meta 47 + else if tag != null then 48 + builtins.unsafeGetAttrPos "tag" args 42 49 else 43 50 builtins.unsafeGetAttrPos "rev" args 44 51 ); ··· 59 66 "domain" 60 67 "owner" 61 68 "repo" 69 + "tag" 62 70 "rev" 63 71 "fetchSubmodules" 64 72 "forceFetchGit" ··· 77 85 fetchzip.override { withUnzip = false; } 78 86 else 79 87 fetchzip; 88 + 89 + revWithTag = if tag != null then "refs%2Ftags%2F${tag}" else rev; 80 90 81 91 fetcherArgs = 82 92 ( 83 93 if useFetchGit then 84 94 { 85 95 inherit 96 + tag 86 97 rev 87 98 deepClone 88 99 fetchSubmodules ··· 94 105 } 95 106 else 96 107 { 97 - url = "${baseUrl}/archive/${rev}"; 108 + url = "${baseUrl}/archive/${revWithTag}"; 98 109 extension = "tar.gz"; 99 110 100 111 passthru = {