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

Add custom user config file #46

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brwai
Copy link

@brwai brwai commented Oct 3, 2024

For users who don't have projects under their home directory, the default location of user config file will not work. Adding a new argument option to allow custom user config file path.
Also fixes a problem where user .yarnrc.yml config file does not automatically get created if it doesn't exist.

@brwai brwai force-pushed the brwai/add-custom-user-config branch from ab7f7b8 to d86362e Compare October 3, 2024 17:54
@brwai brwai force-pushed the brwai/add-custom-user-config branch from d86362e to 07325b4 Compare October 3, 2024 17:56
process.env["HOME"] || process.env["USERPROFILE"] || homedir() || "";
this.userFilePath = join(userHome, workspaceFileName);
if (userConfigFile && path.basename(userConfigFile) === this.workspaceFileName) {
this.userFilePath = userConfigFile;
Copy link
Member

Choose a reason for hiding this comment

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

What is the expected behavior if the user passes --userConfigFile and the user when the passed in file does not match the workspace filename (i.e. missing the dot for npmrc file: --userConfigFile npmrc) then userFilePath will be undefined.

Should this be an error or should we chang the else block to check if userFilePath has not been set yet?

Copy link
Author

Choose a reason for hiding this comment

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

If the filename from provided userConfigFile does not match workspace filename, then the if condition is false then the else condition will be triggered therefore setting the default userFilePath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants