@atlassian/wrm-troubleshooting
Version:
A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.
21 lines • 994 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cliLink = void 0;
const cli_truncate_1 = __importDefault(require("cli-truncate"));
const terminal_link_1 = __importDefault(require("terminal-link"));
// Decrease the output size by 10% to avoid spanning the url link across full terminal width.
// We do that because a) the URLs can be quite long b) we indent the URLs when we display them in the terminal.
const maxColumns = process.stdout.columns - Math.floor(process.stdout.columns / 10);
function cliLink(url, label = url) {
const shortLabel = (0, cli_truncate_1.default)(label, maxColumns, { position: 'middle' });
return (0, terminal_link_1.default)(shortLabel, url, {
fallback(text, url) {
return url;
},
});
}
exports.cliLink = cliLink;
//# sourceMappingURL=cliUtils.js.map