Skip to content

Commit 6c54280

Browse files
committed
fix: Make copilot-install-server install the server locally
- Change `copilot-install-dir` default value to use `user-emacs-directory` for constructing the cache path - Modify `copilot-install-server` to handle `shell-file-name` correctly when using connection-local variables
1 parent 07aa83d commit 6c54280

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

copilot.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ find indentation offset."
155155
"The name of the package to install copilot server.")
156156

157157
(defcustom copilot-install-dir (expand-file-name
158-
(locate-user-emacs-file (f-join ".cache" "copilot")))
158+
(f-join user-emacs-directory ".cache" "copilot"))
159159
"Directory in which the servers will be installed."
160160
:risky t
161161
:type 'directory
@@ -360,7 +360,10 @@ Incremented after each change.")
360360
(defun copilot-install-server ()
361361
"Interactively install server."
362362
(interactive)
363-
(if-let* ((default-directory (if (file-remote-p default-directory)
363+
(if-let* ((shell-file-name (if (connection-local-p shell-file-name)
364+
(default-toplevel-value 'shell-file-name)
365+
shell-file-name))
366+
(default-directory (if (file-remote-p default-directory)
364367
"~/"
365368
default-directory))
366369
(npm-binary (executable-find "npm")))

0 commit comments

Comments
 (0)