SimpleX-Chat/update-sha256.awk
Evgeny Poberezkin ce3d7f21b0
haskell nix flake CI (#222)
* Adds preliminary flake

This nix flake should be enough to try and build an android library.

* add sha256map

* bump

* bump index-state

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
2022-01-24 19:42:41 +00:00

23 lines
462 B
Awk

BEGIN {
print "{"
loc=""
ref=""
isGit=false
}
/source-repository-package/ { loc=""; ref=""; isGit=false; }
/type: git/ { isGit=true; }
/location/ && isGit == true { loc=$2 }
/tag/ && isGit == true { ref=$2 }
isGit == true && loc != "" && ref != "" {
cmd = "nix-prefetch-git --quiet "loc" "ref" | jq -r .sha256"
cmd | getline sha256
close(cmd)
print " \""loc"\".\""ref"\" = \""sha256"\";";
isGit=false; loc=""; ref="";
}
END {
print "}"
}