branch: elpa/hyperdrive
commit 8700e9abcc7762f9ca8d83050a1ec22932ca3b82
Author: Joseph Turner <[email protected]>
Commit: Joseph Turner <[email protected]>
Tidy: (hyperdrive-install) Consolidate let-bindings, reduce nesting
---
hyperdrive.el | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/hyperdrive.el b/hyperdrive.el
index 3a1b90329f..61dee6af4e 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -1316,7 +1316,8 @@ If FORCEP, don't prompt for confirmation before
downloading."
(when (h/gateway-installed-p)
(unless (yes-or-no-p "Download and reinstall/upgrade
hyper-gateway-ushin? ")
(h/user-error "Not downloading; aborted"))))
- (let ((urls-and-hashes (alist-get system-type h/gateway-urls-and-hashes)))
+ (let ((urls-and-hashes (alist-get system-type h/gateway-urls-and-hashes))
+ (destination (expand-file-name h/gateway-program h/gateway-directory)))
(cl-labels
((try ()
(if-let ((url-and-hash (pop urls-and-hashes)))
@@ -1364,14 +1365,12 @@ If FORCEP, don't prompt for confirmation before
downloading."
url)
(try)))
(then (file-name)
- (let ((destination-name
- (expand-file-name h/gateway-program h/gateway-directory)))
- (when (file-exists-p destination-name)
- (move-file-to-trash destination-name))
- (unless (file-directory-p h/gateway-directory)
- (mkdir h/gateway-directory t))
- (rename-file file-name destination-name)
- (chmod destination-name #o755))
+ (when (file-exists-p destination)
+ (move-file-to-trash destination))
+ (unless (file-directory-p h/gateway-directory)
+ (mkdir h/gateway-directory t))
+ (rename-file file-name destination)
+ (chmod destination #o755)
(setf h/install-process nil)
(h/menu-refresh)
(h/message "Gateway installed. Try \\[%s]"