Skip to content

Commit 8eef7fa

Browse files
authored
Merge pull request #3 from cowboyd/less-chatty-output
put debug output behind a flag
2 parents 9ed240e + 1f60b28 commit 8eef7fa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

add-node-modules-path.el

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@
3131

3232
;;; Code:
3333

34+
;;;###autoload
35+
(defvar add-node-modules-path-debug nil
36+
"Enable verbose output when non nil.")
37+
3438
;;;###autoload
3539
(defun add-node-modules-path ()
40+
"Search the current buffer's parent directories for `node_modules/.bin`.
41+
If it's found, then add it to the `exec-path'."
3642
(let* ((root (locate-dominating-file
3743
(or (buffer-file-name) default-directory)
3844
"node_modules"))
@@ -42,8 +48,10 @@
4248
(progn
4349
(make-local-variable 'exec-path)
4450
(add-to-list 'exec-path path)
45-
(message "added node_modules to exec-path"))
46-
(message "node_modules not found"))))
51+
(when add-node-modules-path-debug
52+
(message (concat "added " path " to exec-path"))))
53+
(when add-node-modules-path-debug
54+
(message (concat "node_modules not found in " root))))))
4755

4856
(provide 'add-node-modules-path)
4957

0 commit comments

Comments
 (0)