UNPKG

@citiwave/im-disclaimer-modal

Version:

A customizable React disclaimer modal component with theme support

25 lines (24 loc) 980 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getConfig = getConfig; exports.getDefaultDirectory = getDefaultDirectory; const fs_extra_1 = __importDefault(require("fs-extra")); const path_1 = __importDefault(require("path")); async function getConfig() { const homeDir = process.env.HOME || process.env.USERPROFILE; const configFile = path_1.default.join(homeDir, '.im-disclaimer', 'config.json'); try { return await fs_extra_1.default.readJson(configFile); } catch (error) { throw new Error('Configuration not found. Please run setup first.'); } } async function getDefaultDirectory() { const config = await getConfig(); // Don't resolve against cwd since the path in config is already relative to the project root return config.defaultDirectory; }