microcks / microcks/microcks-cli
Cross-Platform Path Separator Inconsistencies via `path` Package
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 52
- Forks
- 68
- Ø Merge
- 6 Std. 54 Min.
- Gemergte PRs (30 T.)
- 10
Beschreibung
### 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.
---
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in pkg/config/localconfig.go bei etwa den Zeilen 112-142 und verfolge, wie Konfigurationsverzeichnisse zusammengesetzt und erstellt werden. Überprüfe die Änderung mit einem Windows-Pfad wie C:\Users\Name und berücksichtige Befehle wie microcks login; als abgeschlossen gilt die Änderung, wenn Konfigurationspfade native Trennzeichen verwenden, ohne Fehler durch gemischte Formate.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- go
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 82/100