Add rake run-command recipe
This commit is contained in:
parent
4500cf9cb5
commit
b114fd0d71
@ -313,6 +313,20 @@
|
||||
:command-line "cargo build --release"
|
||||
:working-dir project-dir)))))
|
||||
|
||||
(defun run-command-recipe-rake ()
|
||||
(when-let* ((rake-dir (or (locate-dominating-file default-directory "Rakefile")
|
||||
(locate-dominating-file default-directory "Rakefile.rb")))
|
||||
(cmds (->> (shell-command-to-string "rake -T")
|
||||
(s-split "\n")
|
||||
(-map (lambda (s) (s-split-up-to " " s 2)))
|
||||
(-map (lambda (l) (s-join " " (-take 2 l))))
|
||||
(-filter (-not 'string-empty-p)))))
|
||||
(-map (lambda (cmd)
|
||||
(list :command-name (cadr (s-split " " cmd))
|
||||
:command-line cmd
|
||||
:working-dir rake-dir))
|
||||
cmds)))
|
||||
|
||||
:general
|
||||
(leader-map "\"" #'run-command)
|
||||
:custom
|
||||
@ -332,6 +346,7 @@
|
||||
run-command-recipe-web-ext
|
||||
run-command-recipe-pip
|
||||
run-command-recipe-maven
|
||||
run-command-recipe-cargo)))
|
||||
run-command-recipe-cargo
|
||||
run-command-recipe-rake)))
|
||||
|
||||
(provide 'init-run-command)
|
||||
|
Loading…
Reference in New Issue
Block a user