microcks / microcks/microcks-cli
Cross-Platform Path Separator Inconsistencies via `path` Package
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 52
- Forks
- 68
- Avg merge
- 6h 54m
- Merged PRs (30d)
- 10
Description
### Describe the bug
### Description
In `pkg/config/localconfig.go`, configuration directory pathing and creation utilities use the `path` package instead of `path/filepath`. The Go standard library `path` package is strictly designed for forward-slash URL paths and does not handle Windows backslashes (`\`).
### Impact
On Windows systems, paths are constructed in a mixed format (e.g. `C:\Users\Name/.config/microcks/config`), which causes file system APIs and permissions logic to fail or look in wrong locations.
### Code Reference
* [pkg/config/localconfig.go](file:///c:/Users/Hp/microcks-cli/pkg/config/localconfig.go#L112-L142)
### Diagram
```mermaid
graph TD
A["getHomeDir() on Windows -> 'C:\\Users\\Name'"] --> B["path.Join(homeDir, '.config', 'microcks')"]
B --> C["Result: 'C:\\Users\\Name/.config/microcks'"]
C --> D["os.MkdirAll() creates folders with mixed slashes, breaking standard Windows paths"]
```
### Steps to Reproduce
1. Execute any command that reads or writes config on Windows (e.g., `microcks login`).
2. The config directory is created/resolved in a non-native path format with mixed slashes.
---
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/config/localconfig.go around lines 112-142 and trace how configuration directories are constructed and created. Verify the change with a Windows path case such as C:\Users\Name, and consider commands such as microcks login; done means configuration paths use native separators without mixed-format failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100