Skip to content

pnpm config path --global: print global config path #9977

@karlhorky

Description

@karlhorky

Contribution

Describe the user story

A user wants to set an array value such as minimumReleaseAgeExclude globally with a simple command, without having to remember the global config file locations (~/AppData/Local/pnpm/config/rc, ~/Library/Preferences/pnpm/rc or ~/.config/pnpm/rc) for the platform they are on

Describe the solution you'd like

pnpm config path --global could print the location for the global config file, so that the file can be edited dynamically with something like echo:

echo -e "minimum-release-age-exclude[]=webpack\nminimum-release-age-exclude[]=react" >> "$(pnpm config path --global)"
Show YAML version

Probably YAML is not supported as of pnpm v10 in the global config file, but this is the version that I first started with

echo -e "minimumReleaseAgeExclude:\n  - webpack\n  - react" >> "$(pnpm config path --global)"

pnpm config path without the --global flag (if it should be supported) would probably follow the same config resolution and print:

  1. the local config file path if it exists
  2. the global config file path if the local config file doesn't exist

Describe the drawbacks of your solution

It is not a single-command solution to setting array values

Describe alternatives you've considered

pnpm config set could allow setting array values:

$ pnpm config set "minimumReleaseAgeExclude[]" webpack
$ pnpm config set "minimumReleaseAgeExclude[]" react

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions