Skip to content

Refactor config path handling to filepath#269

Open
mynk8 wants to merge 1 commit intomicrocks:masterfrom
mynk8:fix-path
Open

Refactor config path handling to filepath#269
mynk8 wants to merge 1 commit intomicrocks:masterfrom
mynk8:fix-path

Conversation

@mynk8
Copy link
Copy Markdown

@mynk8 mynk8 commented May 3, 2026

Description

Using filepath keeps Unix behavior unchanged while producing native separators on Windows. MICROCKS_CONFIG_DIR remains respected.

Related issue(s)

Fixes #268

@mynk8 mynk8 requested review from Harsh4902, lbroudoux and yada as code owners May 3, 2026 04:59
Add helper to compute config path from home with fallback
Switch to filepath for path joins and directory ops in local config code
for correctly handling platform conventions

Signed-off-by: mynk8 <mr.mayankgame@gmail.com>
Copy link
Copy Markdown
Member

@lbroudoux lbroudoux left a comment

Choose a reason for hiding this comment

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

Looks legit but I have one question thought on the getHomeDir() function provenance. Thanks!

Comment thread pkg/config/config.go
)

func defaultConfigPath() string {
homeDir, err := getHomeDir()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry if it's a dumb question, but where does this getHomeDir() method come from?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This was in localconfig.go

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Although I would agree it's a bit confusing to be there and had the thought of whether move this into utility functions.

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.

CLI reports non-native default config path on Windows

2 participants