@pnpm/cli-utils
Version:
Utils for pnpm commands
26 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getConfig = getConfig;
const cli_meta_1 = require("@pnpm/cli-meta");
const config_1 = require("@pnpm/config");
const default_reporter_1 = require("@pnpm/default-reporter");
async function getConfig(cliOptions, opts) {
const { config, warnings } = await (0, config_1.getConfig)({
cliOptions,
globalDirShouldAllowWrite: opts.globalDirShouldAllowWrite,
packageManager: cli_meta_1.packageManager,
rcOptionsTypes: opts.rcOptionsTypes,
workspaceDir: opts.workspaceDir,
checkUnknownSetting: opts.checkUnknownSetting,
ignoreNonAuthSettingsFromLocal: opts.ignoreNonAuthSettingsFromLocal,
});
config.cliOptions = cliOptions;
if (opts.excludeReporter) {
delete config.reporter; // This is a silly workaround because @pnpm/core expects a function as opts.reporter
}
if (warnings.length > 0) {
console.warn(warnings.map((warning) => (0, default_reporter_1.formatWarn)(warning)).join('\n'));
}
return config;
}
//# sourceMappingURL=getConfig.js.map