nodejs-repl.el icon indicating copy to clipboard operation
nodejs-repl.el copied to clipboard

nvm-which fails if no .nvmrc present

Open titaniumbones opened this issue 4 years ago • 0 comments

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))

titaniumbones avatar Dec 02 '20 20:12 titaniumbones