nodejs-repl.el
nodejs-repl.el copied to clipboard
nvm-which fails if no .nvmrc present
Ifhtere's no nvm-which present, then the nvm-which funciton in the docs fails. I was able to fix it with:
(defun nvm-which ()
(let ((output (shell-command-to-string "source ~/.nvm/nvm.sh; nvm which")))
(if (cl-search "Node Version" output)
(setq output (shell-command-to-string "source ~/.nvm/nvm.sh; nvm which current"))
(setq output (cadr (split-string output "[\n]+" t))))
(message output)
output))