fume-fhir-converter
Version:
FHIR-Utilized Mapping Engine - Community
30 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFumeIndexFilePath = exports.getCachePackagesPath = exports.getCachePath = void 0;
const tslib_1 = require("tslib");
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
const fs_1 = tslib_1.__importDefault(require("fs"));
const os_1 = tslib_1.__importDefault(require("os"));
const path_1 = tslib_1.__importDefault(require("path"));
const logger_1 = require("../logger");
const getCachePath = (innerFolder = '') => {
const cachePath = path_1.default.join(os_1.default.homedir(), '.fhir', innerFolder);
if (!fs_1.default.existsSync(cachePath)) {
fs_1.default.mkdirSync(cachePath, { recursive: true });
(0, logger_1.getLogger)().info(`Directory '${cachePath}' created successfully.`);
}
return cachePath;
};
exports.getCachePath = getCachePath;
const getCachePackagesPath = () => {
return (0, exports.getCachePath)('packages');
};
exports.getCachePackagesPath = getCachePackagesPath;
const getFumeIndexFilePath = () => {
return path_1.default.join(path_1.default.resolve('.'), 'fhirPackageIndex.json');
};
exports.getFumeIndexFilePath = getFumeIndexFilePath;
//# sourceMappingURL=getCachePath.js.map