UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint manager to set up, configure and monitor 3D printers. Our aim is to provide extremely optimized websocket performance and reliability.

38 lines (37 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "MonsterPiService", { enumerable: true, get: function() { return MonsterPiService; } }); const _node = require("@sentry/node"); const _fs = require("fs"); const _serverconstants = require("../../server.constants"); class MonsterPiService { monsterPiVersion = null; logger; fileLocation = _serverconstants.AppConstants.monsterPiFilePath; constructor(loggerFactory){ this.logger = loggerFactory(MonsterPiService.name); } getMonsterPiVersionSafe() { const fileExists = (0, _fs.existsSync)(this.fileLocation); if (!fileExists) { return null; } try { const contents = (0, _fs.readFileSync)(this.fileLocation); this.monsterPiVersion = contents.toString().replaceAll(" ", ""); return this.monsterPiVersion; } catch (e) { this.logger.warn("Error checking MonsterPi version"); (0, _node.captureException)(e); } return null; } } //# sourceMappingURL=monsterpi.service.js.map