From ee14f070df766bddd8710124dbcfc2737422882d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 18 Oct 2017 12:35:11 +0200 Subject: Emacs: Add npm-yarn aliases --- emacs/.emacs.d/main.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'emacs') diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el index d138d97..80ff2d5 100644 --- a/emacs/.emacs.d/main.el +++ b/emacs/.emacs.d/main.el @@ -494,6 +494,7 @@ ((string-equal (projectile-project-type) "node-yarn") (cmd-to-echo "yarn" "install")) (t (cmd-to-echo "npm" "install"))))) + (defalias 'npm-install #'yarn-install) (defun yarn-add-dev (package) (interactive "spackage: ") @@ -502,6 +503,7 @@ ((string-equal (projectile-project-type) "node-yarn") (cmd-to-echo "yarn" (concat "add --dev " package))) (t (cmd-to-echo "npm" (concat "install --save-dev " package)))))) + (defalias 'npm-save-dev #'yarn-add-dev) (defun yarn-add (package) (interactive "spackage: ") @@ -510,6 +512,7 @@ ((string-equal (projectile-project-type) "node-yarn") (cmd-to-echo "yarn" (concat "add " package))) (t (cmd-to-echo "npm" (concat "install --save " package)))))) + (defalias 'npm-save #'yarn-add) (defun yarn-remove (package) (interactive "spackage: ") @@ -518,6 +521,7 @@ ((string-equal (projectile-project-type) "node-yarn") (cmd-to-echo "yarn" (concat "remove " package))) (t (cmd-to-echo "npm" (concat "remove " package)))))) + (defalias 'npm-remote #'yarn-remove) (defun yarn-run (cmd) (interactive (list @@ -527,6 +531,7 @@ ((string-equal (projectile-project-type) "node-yarn") (cmd-to-echo "yarn" (concat "run " cmd))) (t (cmd-to-echo "npm" (concat "run " cmd)))))) + (defalias 'npm-run #'yarn-run) (defun npx-run (cmd) (interactive "scommand: ") -- cgit 1.4.1