diff --git a/.gitattributes b/.gitattributes index 0309e02..88c03ce 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ scripts/*.sh text eol=lf +game_data/** text eol=lf diff --git a/README.md b/README.md index 4a723ef..f5e6553 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,31 @@ A web viewer for backups of the Android game **[Idle Fantasy](https://github.com ## Installation +### Windows (PowerShell) + ```powershell python -m venv .venv .\.venv\Scripts\Activate.ps1 pip install -r requirements.txt ``` +### WSL (recommended for deploy) + +Keep the repo on the Linux filesystem (not `/mnt/c/`) to avoid CRLF/git/deploy issues between Windows and WSL: + +```bash +# one-time clone or copy to e.g. ~/source/idle-fantasy-viewer +cd ~/source/idle-fantasy-viewer +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +``` + +Open in **Cursor**: *File → Open Folder in WSL…* → `~/source/idle-fantasy-viewer` +Windows path (Explorer): `\\wsl.localhost\Ubuntu-24.04\home\markus\source\idle-fantasy-viewer` + +Run tests, dev server, and `bash scripts/deploy.sh` from the same WSL shell. + ## Usage ### Start server and import a backup diff --git a/scripts/sync_game_data.py b/scripts/sync_game_data.py index 0948b9d..aca7520 100644 --- a/scripts/sync_game_data.py +++ b/scripts/sync_game_data.py @@ -58,7 +58,7 @@ def main() -> None: synced.append(name) print(f" {name}") - MANIFEST.write_text( + manifest_body = ( json.dumps( { "source_repo": f"https://github.com/{REPO}", @@ -69,9 +69,10 @@ def main() -> None: }, indent=2, ) - + "\n", - encoding="utf-8", + + "\n" ) + with MANIFEST.open("w", encoding="utf-8", newline="\n") as manifest_file: + manifest_file.write(manifest_body) print(f"Synced {len(synced)} files -> {OUT_DIR}") print(f"Manifest: {MANIFEST} (sha {sha[:12]})")