Spaces:
Running
Running
Download patch_version.mjs from bep40/hangmu-docker: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/spaces/bep40/hangmu-docker/resolve/main/patch_version.mjs
- Command line
-
hf download hf://spaces/bep40/hangmu-docker/patch_version.mjs
-
curl -L -o patch_version.mjs https://huggingface.co/spaces/bep40/hangmu-docker/resolve/main/patch_version.mjs
707 Bytes
| /* patch_version.mjs — v17: bump VERSION_ID len v17 de khop cache-bust ?v=17. */ | |
| import fs from 'node:fs' | |
| const path = 'backend.py' | |
| try { | |
| const s = fs.readFileSync(path, 'utf8') | |
| let out = s | |
| for (const v of ['v16', 'v15', 'v14', 'v13', 'v12', 'v11', 'v10']) { | |
| if (out.includes(`VERSION_ID = "${v}"`)) { | |
| out = out.split(`VERSION_ID = "${v}"`).join('VERSION_ID = "v17"') | |
| break | |
| } | |
| } | |
| if (out.includes('VERSION_ID = "v17"')) { | |
| console.log('backend.py VERSION_ID -> v17 OK') | |
| } else { | |
| console.warn('patch_version: VERSION_ID marker not found') | |
| } | |
| fs.writeFileSync(path, out) | |
| } catch (e) { | |
| console.warn('patch_version SKIP: ' + String(e.message || e)) | |
| } | |
| process.exit(0) |