From 1a71939910abc20d0e72427e6a0cfe2262564c0c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 16 Dec 2020 19:09:44 -0600 Subject: Bootstrap straight.el on Windows by, just, git cloning it --- config.org | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'config.org') diff --git a/config.org b/config.org index a01c872..70c49e4 100644 --- a/config.org +++ b/config.org @@ -39,21 +39,36 @@ Let’s configure Emacs using Org mode, they said. It’ll be fun, they said. *** Straight.el -This still doesn’t work under Windows – I have to manually download the [[https://github.com/raxod502/straight.el/archive/master.zip][repo archive]] and unzip it. Not the biggest burden, I suppose. +Since for whatever reason, Straight can't bootstrap itself on Windows +-- I've wrapped it in a function here and added the direct git command +when it errors. #+begin_src emacs-lisp - (defvar bootstrap-version) - (let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) - (bootstrap-version 5)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) + (defun acdw/bootstrap-straight () + (defvar bootstrap-version) + (let ((bootstrap-file + (expand-file-name + "straight/repos/straight.el/bootstrap.el" + user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + (concat "https://raw.githubusercontent.com/" + "raxod502/straight.el/develop/install.el") + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage))) + + (unless (ignore-errors (acdw/bootstrap-straight)) + (message "Straight.el didn't bootstrap correctly. Cloning directly...") + (call-process "git" nil (get-buffer-create "*bootstrap-straight-messages*") nil + "clone" + "https://github.com/raxod502/straight.el" + (expand-file-name "straight/repos/straight.el" + user-emacs-directory)) + (acdw/bootstrap-straight)) #+end_src *** Use-package -- cgit 1.4.1-21-gabe81