deno: update update script to changed deno

This commit is contained in:
06kellyjac
2021-03-12 19:34:26 +00:00
parent 9611f03177
commit c034a1412b
5 changed files with 113 additions and 118 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
import {
genValueRegExp,
logger,
nixPrefetch,
read,
run,
sha256RegExp,
versionRegExp,
write,
@@ -16,10 +16,11 @@ interface Replacer {
const log = logger("src");
const prefetchSha256 = (nixpkgs: string, version: string) =>
nixPrefetch(["-f", nixpkgs, "deno.src", "--rev", version]);
run("nix-prefetch", ["-f", nixpkgs, "deno.src", "--rev", version]);
const prefetchCargoSha256 = (nixpkgs: string) =>
nixPrefetch(
[`{ sha256 }: (import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { outputHash = sha256; })`],
run(
"nix-prefetch",
[`{ sha256 }: (import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { inherit sha256; })`],
);
const replace = (str: string, replacers: Replacer[]) =>
@@ -53,7 +54,6 @@ export async function updateSrc(
[
genVerReplacer("version", trimVersion),
genShaReplacer("sha256", sha256),
genShaReplacer("cargoSha256", ""), // Empty ready for prefetchCargoSha256
],
);
log("Fetching cargoSha256 for:", sha256);