cli: disable patch-macos (only --undo/-u works)

This has been deprecated for a while. I will remove it entirely with the 2.1
release, but for now, you can no longer patch your app bundle with this.

Use 'doom env refresh' instead.
This commit is contained in:
Henrik Lissner 2019-07-18 13:21:05 +02:00
parent 8b27d19e0b
commit c3354e2620
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -65,24 +65,7 @@ depending on your shell configuration and isn't always reliable.")
(message "%s successfully unpatched" appdir)) (message "%s successfully unpatched" appdir))
((file-exists-p newbin) ((file-exists-p newbin)
(user-error "%s is already patched" appdir)) (user-error "%s is already patched. Use 'doom patch-macos --undo' to unpatch it"
appdir))
((or doom-auto-accept ((user-error "patch-macos has been disabled. Please use 'doom env refresh' instead")))))
(y-or-n-p
(concat "(WARNING: patch-macos is deprecated, use `doom env refresh` instead)\n\n"
"Doom would like to patch your Emacs.app bundle so that it respects\n"
"your shell configuration. For more information on why and how, run\n\n"
" bin/doom help patch-macos\n\n"
"Patch Emacs.app?")))
(message "Patching '%s'" appdir)
(copy-file oldbin newbin nil nil nil 'preserve-permissions)
(unless (file-exists-p newbin)
(error "Failed to copy %s to %s" oldbin newbin))
(with-temp-buffer
(insert "#!/usr/bin/env bash\n"
"args=\"$@\"\n"
"pwd=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\"\n"
"exec \"$SHELL\" -l -c \"$pwd/RunEmacs $args\"")
(write-file oldbin)
(chmod oldbin (file-modes newbin)))
(message "%s successfully patched" appdir)))))