Update run-command config to latest version

This commit is contained in:
Jeremy Dormitzer 2023-03-10 08:51:43 -05:00
parent 98c3c46e45
commit 35bdf63045

View File

@ -2,19 +2,12 @@
;; A handy package for running external commands
(use-package run-command
:straight (run-command :host github :repo "bard/emacs-run-command"
:fork (:host github :repo "jdormit/emacs-run-command" :branch "master"))
:init
(defvar-local run-command-local-commands nil)
(put 'run-command-local-commands 'safe-local-variable (lambda (_) t))
(defvar-local run-command-project-local-commands nil)
(put 'run-command-project-local-commands 'safe-local-variable (lambda (_) t))
:config
(general-def run-command-term-minor-mode-map
[remap recompile] #'run-command-term-recompile
"g" nil)
(general-def 'normal run-command-term-minor-mode-map "gr" #'run-command-term-recompile)
(defun run-command-recipe-terraform ()
(when (directory-files default-directory
nil
@ -335,8 +328,9 @@
(defun get-script-run-command (file)
(with-temp-buffer
(insert-file-contents-literally file)
(when-let* ((line (s-trim (thing-at-point 'line t))))
(cadr (s-match (rx "#!" (group (1+ anychar))) line)))))
(when-let* ((line (thing-at-point 'line t))
(line-trimmed (s-trim line)))
(cadr (s-match (rx "#!" (group (1+ anychar))) line-trimmed)))))
(defun run-command-recipe-scripts ()
(let* ((root-dir (expand-file-name (or (projectile-project-root) default-directory)))
@ -363,7 +357,8 @@
:general
(leader-map "\"" #'run-command)
:custom
(run-command-run-method 'async-shell)
(run-command-default-runner 'run-command-runner-compile)
(run-command-completion-method 'completing-read)
(run-command-recipes '(run-command-recipe-terraform
run-command-recipe-local
run-command-recipe-package-json