emacs-emojify

fork of https://github.com/iqbalansari/emacs-emojify
Log | Files | Refs | LICENSE

commit a5d76684623bd9bb14b251c2225936655d1e0fa3
parent f2edcba0f6b19717e38a3e96adc8adc262f3b5a5
Author: Sebastien Le Maguer <lemagues@tcd.ie>
Date:   Sun, 20 Jan 2019 16:08:21 +0000

Add error message when the hash is incorrect

Diffstat:
Memojify.el | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/emojify.el b/emojify.el @@ -1394,8 +1394,10 @@ non-interactive mode and `emojify-download-emojis-p' is set to `ask'." (let ((downloaded-sha (with-temp-buffer (insert-file-contents-literally destination) (secure-hash 'sha256 (current-buffer))))) - (when (string= downloaded-sha (ht-get data "sha256")) - destination)))) + (if (string= downloaded-sha (ht-get data "sha256")) + destination + (error "cannot download from \"%s\" as %s != %s" + (ht-get data "url") downloaded-sha (ht-get data "sha256")))))) (defun emojify--extract-emojis (file) "Extract the tar FILE in emoji directory."