Skip to content

Extract fixpath core logic into dazzle-filekit #17

@djdarcy

Description

@djdarcy

Extract fixpath core logic into dazzle-filekit

Problem

dz fixpath (in dazzlecmd) has path normalization and search logic that would be useful as a shared library. Currently it's a CLI-only tool -- other tools like dazzlelink can't reuse its path resolution capabilities.

Proposed solution

Extract core functions from dazzlecmd/fixpath.py into dazzle_filekit/pathfix.py:

  • fix_path_string() -- normalize slashes, encoding, platform quirks
  • probe_alt_platform() -- try MSYS, WSL, UNC path variants
  • search_by_filename() -- fuzzy file search as last resort

dazzlecmd/fixpath.py becomes a thin CLI wrapper over dazzle_filekit.pathfix.
dazzlelink can then import the path normalization for the "both paths broken" rebase case.

Acceptance criteria

  • dazzle_filekit/pathfix.py created with extracted functions
  • dazzlecmd/fixpath.py refactored to use the library
  • dazzlelink rebase uses pathfix as Case 4 fallback
  • Tests for pathfix module
  • Version bumps for dazzle-filekit and dazzlecmd

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions