all repos — nixfiles @ 590c8d7e92a0dd1d7265a8661c634c70e7f8505d

System and user configuration, managed by nix and home-manager

Emacs: Add npx-run command for node projects
Alan Pearce alan@alanpearce.eu
Thu, 05 Oct 2017 14:32:51 +0200
commit

590c8d7e92a0dd1d7265a8661c634c70e7f8505d

parent

db81c0b127dd23c71ca498aad40764bd0cb63be3

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -528,6 +528,11 @@ ((string-equal (projectile-project-type) "node-yarn")                   (cmd-to-echo "yarn" (concat "run " cmd)))
                  (t (cmd-to-echo "npm" (concat "run " cmd))))))
 
+            (defun npx-run (cmd)
+              (interactive "scommand: ")
+              (projectile-with-default-dir (projectile-project-root)
+                (cmd-to-echo "npx" cmd)))
+
             (defun ap/open-project (&optional arg)
               (interactive "P")
               (let ((project-dir (projectile-completing-read