Skip to content

Refactor config path handling to filepath - #269

Closed
mynk8 wants to merge 3 commits into
microcks:masterfrom
mynk8:fix-path
Closed

Refactor config path handling to filepath#269
mynk8 wants to merge 3 commits into
microcks:masterfrom
mynk8:fix-path

Conversation

@mynk8

@mynk8 mynk8 commented May 3, 2026

Copy link
Copy Markdown

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>

@lbroudoux lbroudoux left a comment

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.

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

Comment thread pkg/config/config.go Outdated
)

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.

@mynk8
mynk8 requested a review from lbroudoux May 11, 2026 06:52
@Harsh4902

Copy link
Copy Markdown
Member

Hey @mynk8, can you again take look on this PR. Please resolve the merge conflict, and will be happy to merge it when it's ready.

@Harsh4902 Harsh4902 added component/cli keep-open Explicitily keep open labels Aug 15, 2026
@mynk8

mynk8 commented Aug 15, 2026

Copy link
Copy Markdown
Author

Closing this PR, the problem it solved is now fixed in the main branch so this change is not needed anymore and outdated.

@mynk8 mynk8 closed this Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/cli keep-open Explicitily keep open

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI reports non-native default config path on Windows

3 participants