UNPKG

@atlassian/wrm-troubleshooting

Version:

A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.

20 lines 968 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.cliLink = cliLink; 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; }, }); } //# sourceMappingURL=cliUtils.js.map