Allow installation from locally cloned git repo (#58)

pkg-info might contain a #f checksum, causing substring to raise a contract
error. This commit avoids the error.
main
sorawee 5 years ago committed by GitHub
parent c41b2e1b2d
commit 47a0a4e250

@ -4,6 +4,6 @@
(define (pkg-checksum [pkg "quad"] #:short [short? #false])
(match (for/or ([scope (in-list '(user installation shared))])
(hash-ref (read-pkgs-db scope) pkg #false))
[(pkg-info _ checksum _) (if short? (substring checksum 0 7) checksum)]
[_ "checksum not found"]))
(hash-ref (read-pkgs-db scope) pkg #false))
[(pkg-info _ (? string? checksum) _) (if short? (substring checksum 0 7) checksum)]
[_ "checksum not found"]))

Loading…
Cancel
Save