UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint, Klipper, PrusaLink and BambuLab manager to set up, configure and monitor 3D printers. Our aim is to provide neat overview over your farm.

28 lines (27 loc) 873 B
import { AppConstants } from "../../server.constants.js"; import { captureException } from "@sentry/node"; import { existsSync, readFileSync } from "fs"; //#region src/services/core/monsterpi.service.ts var MonsterPiService = class MonsterPiService { monsterPiVersion = null; logger; fileLocation = AppConstants.monsterPiFilePath; constructor(loggerFactory) { this.logger = loggerFactory(MonsterPiService.name); } getMonsterPiVersionSafe() { if (!existsSync(this.fileLocation)) return null; try { const contents = readFileSync(this.fileLocation); this.monsterPiVersion = contents.toString().replaceAll(" ", ""); return this.monsterPiVersion; } catch (e) { this.logger.warn("Error checking MonsterPi version"); captureException(e); } return null; } }; //#endregion export { MonsterPiService }; //# sourceMappingURL=monsterpi.service.js.map