1
0

Add KOReader option
All checks were successful
Build and test project / build-and-test (push) Successful in 1m32s

This commit is contained in:
2026-03-21 16:32:15 +01:00
parent 620d8a1929
commit aaf3bf8749
19 changed files with 659 additions and 344 deletions

View File

@@ -0,0 +1,34 @@
const fs = require('fs');
const path = require('path');
const { WEBROOT, WEBROOT_FIRMWARE, FIRMWARE_PATH } = require('./paths');
function hasNickelMenuAssets() {
return fs.existsSync(path.join(WEBROOT, 'nickelmenu', 'NickelMenu.zip'))
&& fs.existsSync(path.join(WEBROOT, 'nickelmenu', 'kobo-config.zip'));
}
function hasKoreaderAssets() {
return fs.existsSync(path.join(WEBROOT, 'koreader', 'koreader-kobo.zip'))
&& fs.existsSync(path.join(WEBROOT, 'koreader', 'release.json'));
}
function hasFirmwareZip() {
return fs.existsSync(FIRMWARE_PATH);
}
function setupFirmwareSymlink() {
try { fs.unlinkSync(WEBROOT_FIRMWARE); } catch {}
fs.symlinkSync(path.resolve(FIRMWARE_PATH), WEBROOT_FIRMWARE);
}
function cleanupFirmwareSymlink() {
try { fs.unlinkSync(WEBROOT_FIRMWARE); } catch {}
}
module.exports = {
hasNickelMenuAssets,
hasKoreaderAssets,
hasFirmwareZip,
setupFirmwareSymlink,
cleanupFirmwareSymlink,
};