@labnex/cli
Version:
CLI for Labnex, an AI-Powered Testing Automation Platform
24 lines • 813 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadProjectConfig = loadProjectConfig;
exports.saveProjectConfig = saveProjectConfig;
const fs_1 = require("fs");
const path_1 = require("path");
const CONFIG_FILE = 'labnex.config.json';
function loadProjectConfig(cwd = process.cwd()) {
const path = (0, path_1.join)(cwd, CONFIG_FILE);
if (!(0, fs_1.existsSync)(path))
return null;
try {
const data = JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
return data;
}
catch {
return null;
}
}
function saveProjectConfig(config, cwd = process.cwd()) {
const path = (0, path_1.join)(cwd, CONFIG_FILE);
(0, fs_1.writeFileSync)(path, JSON.stringify(config, null, 2), 'utf8');
}
//# sourceMappingURL=projectConfig.js.map