"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