"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOsDetails = getOsDetails;
const linux_os_release_1 = require("./linux_os_release");
const logger_1 = __importDefault(require("../../logger"));
let cachedOsDetails = null;
let logDebugError = null;
try {
    if (process.platform === 'linux') {
        cachedOsDetails = (0, linux_os_release_1.extractLinuxOsRelease)();
    }
}
catch (error) {
    // Logger is not initialized at this point, so we store the error and log it on the first
    // getOsDetails() call
    logDebugError = error;
    cachedOsDetails = null;
}
function getOsDetails() {
    if (logDebugError) {
        (0, logger_1.default)().debug('Error extracting OS details: %s', logDebugError);
        logDebugError = null;
    }
    return cachedOsDetails;
}
//# sourceMappingURL=index.js.map