deoxxa / npmrc

Switch between different .npmrc files with ease and grace.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: npmrc filename available for use in bash/zsh prompt

dylang opened this issue · comments

I change my npmrc often enough I wouldn't mind having it in my prompt.

I'm not sure if this is practical. Maybe set an ENV whenever it's changed and show that ENV in the prompt?

Maybe this would be better as a wrapper around npmrc?

Good idea! Though you could the around it (on OS X) using:

readlink `npm get userconfig`

or more brittle, but faster:

> readlink ~/.npmrc

to grab the name (on this machine), even more brittle:

readlink ~/.npmrc | cut -d '/' -f 5

Though, yeah could probably change cli to list current npmrc somehow. Setting an env var seems a bit obtrusive.