Spaces:
Runtime error
Runtime error
Download postinstall.js from Brozy123/LineUp-Bot: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/spaces/Brozy123/LineUp-Bot/resolve/main/postinstall.js
- Command line
-
hf download hf://spaces/Brozy123/LineUp-Bot/postinstall.js
-
curl -L -o postinstall.js https://huggingface.co/spaces/Brozy123/LineUp-Bot/resolve/main/postinstall.js
832 Bytes
| // postinstall.js - Ensures native modules compile correctly on Linux/HF | |
| const { execSync } = require("child_process"); | |
| const os = require("os"); | |
| console.log("[INSTALL] Checking environment..."); | |
| // If running on Linux (like HF Spaces), ensure build tools are conceptually ready | |
| // Note: HF Spaces usually has build-tools installed, but this is a safe guard. | |
| if (os.platform() === 'linux') { | |
| console.log("[INSTALL] Linux environment detected. Ensuring native modules are ready..."); | |
| try { | |
| // Rebuild better-sqlite3 if needed | |
| execSync("npm rebuild better-sqlite3", { stdio: "inherit" }); | |
| console.log("[INSTALL] Native modules rebuilt successfully."); | |
| } catch (e) { | |
| console.warn("[INSTALL] Warning: Could not rebuild native modules. If the bot fails, ensure 'build-essential' is installed on the host."); | |
| } | |
| } |