♻️ improve/outsource path model #34
Labels
architecture-improvement
Improves the overall architecture
feature request
New feature or request
severity::okay
This issue needs to be addressed within near time
The
Path
model, originally intended as a simple and more accessible wrapper for golang's filepath, is widely used in the whole project for more specific (type) control. It's currently placed as a model and has no other any internal dependenies.Recent issues and commits showed that this wrapper is not consistent enough and unpredictable in regarding to filesystem case-sensitivity. Because git-nest works on the filesystem level, it's highly important that filehandling is consistent and predictable, while also abstracting away filesystem-level case-sensivitiy.
Thus
Path
should be either rewritten and tested, or an external dependency.Some libraries exist (https://github.com/spf13/afero, https://github.com/chigopher/pathlib), but these seem bigger than just simple lightweight wrappers (which is what's needed).
I don't mind if a
Path
becomes a little struct, but the footprint should be kept small. Maybe something like this is fitting:This keeps the footprint small, while also generating a source of truth (which is something the current "a path is really a string type" cannot give).
The new
Path
should also support windows and network paths, provide conversions, better error handling and byte/text marshaling/unmarshaling.The text was updated successfully, but these errors were encountered: