app/: application configformatters/: formatter configscripts/sync.py: helper that copies files between the host and this repository based on a JSON mapping.mappings.json: default mapping from host paths to their locations in the repo used bysync.py.
scripts/sync.py reads mappings.json and copies each host file into the matching location in the repo. Run it after making changes on the host to capture them in Git.
./scripts/sync.py # host → repo (default)
./scripts/sync.py --to-host # repo → host
./scripts/sync.py --dry-run # preview without writing filesFlags of note:
--maplets you point to another mapping file.--project-rootchanges the base directory for repo paths (defaults to the current directory).--verboseprints each copy action; combine with--dry-runwhen debugging.
The script only uses the Python standard library, so any recent Python 3 should work.
- Place the new config under
app/(or another directory if it makes more sense). - Add a mapping entry to
mappings.json, pairing the host path with the repo path. - Run
./scripts/sync.py --to-hostto push the repo copy back onto the system, or the default direction to pull updates from the host.