UNPKG

workspace-tools

Version:

A collection of utilities that are useful in a git-controlled monorepo managed by one of these tools:

17 lines 685 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getConfigValue = void 0; const git_1 = require("./git"); /** * Get the value of a git config key. Returns null if it's not set. * (Note: setting `throwOnError: true` will cause it to fail if the key is unset.) */ function getConfigValue(options) { const { key, ...gitOptions } = options; const results = (0, git_1.git)(["config", key], gitOptions); // command failure here just means it's not set return results.success ? results.stdout.trim() : null; } exports.getConfigValue = getConfigValue; // Other config helpers can move here in the future //# sourceMappingURL=config.js.map