Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display npmrc profile #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

avidit
Copy link

@avidit avidit commented Oct 10, 2023

How to test pre-release?

☠️ Feature can be unstable and break your prompt!

fisher install pure-fish/pure@feat/npmrc # branch name
set --universal pure_enable_foo_feature true

First contribution?

Check the 👍 Contribute section and the contributing guide.

Specs

New config in conf.d/pure.fish

_pure_set_default pure_enable_npmrc false
_pure_set_default pure_symbol_npmrc_prefix ""
_pure_set_default pure_color_npmrc pore_color_danger ""

Documentation

npmrc helps to switch between different .npmrc files with ease and grace.

Usage

set --universal pure_enable_npmrc true

Acceptance Checks

  • documentation is up-to-date:
  • feature flag is present in conf.d/pure.fish ;
  • symbol is present in conf.d/pure.fish ;
  • tests are passing (I can help you 🤗 ):
  • customization is available ;
  • feature is implemented.

Copy link
Member

@edouard-lopez edouard-lopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the MR!
There is some changes needed, and some tests:

You can check https://github.com/pure-fish/pure/blob/master/tests/_pure_prompt_virtualenv.test.fish for example, then run the tests with

❯ make test-pure-on FISH_VERSION=3.6.1 CMD='fishtape tests/_pure_prompt_npmrc.test.fish'

set --local npmrc ''
set --local npmrc_color (_pure_set_color $pure_color_npmrc)
if test -e "$HOME/.npmrc"
set npmrc (readlink $HOME/.npmrc | cut -d '/' -f 5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readlink has no output when $HOME/.npmrc is a regular file and not a symlink. You don't need to resolve the link just to show the basename.

Suggested change
set npmrc (readlink $HOME/.npmrc | cut -d '/' -f 5)
set npmrc (basename $HOME/.npmrc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement performance, UX or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants