UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

30 lines (27 loc) 1.38 kB
import { getGitCurBranch } from '../git/git.mjs'; import '../node/node-command.mjs'; import '@babel/runtime/helpers/typeof'; import '../nodejs/child_process.mjs'; import '../nodejs/fs.mjs'; import '../nodejs/path.mjs'; import '../validate/validate.mjs'; var genTitle = function genTitle(prefix, checkAll) { var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'LINT'; return "".concat(prefix).concat(checkAll ? "\u3010".concat(name, "\u3011\u5168\u91CF\u6A21\u5F0F") : "\u3010".concat(name, "\u3011\u589E\u91CF\u6A21\u5F0F")); }; var genReportInfo = function genReportInfo(_ref) { var workspace = _ref.workspace, mrUrl = _ref.mrUrl, sourceBranch = _ref.sourceBranch, targetBranch = _ref.targetBranch, repo = _ref.repo, repoUrl = _ref.repoUrl, _ref$checkAll = _ref.checkAll, checkAll = _ref$checkAll === void 0 ? false : _ref$checkAll; var curBranch = getGitCurBranch(workspace, false); var repoAndMrInfo = [mrUrl ? "[".concat(mrUrl, "](").concat(mrUrl, ")") : '', sourceBranch && targetBranch ? "".concat(sourceBranch, " => ").concat(targetBranch) : '', checkAll && repo && repoUrl ? "[".concat(repo, "](").concat(repoUrl, ")") : '', checkAll && curBranch ? "\u5206\u652F: ".concat(curBranch) : ''].filter(function (item) { return item; }); return repoAndMrInfo; }; export { genReportInfo, genTitle };