Skip to content

nvm-which fails if no .nvmrc present #38

Description

@titaniumbones

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions