(filePath: string)
| 117 | }; |
| 118 | |
| 119 | async function specifyServiceHelp(filePath: string) { |
| 120 | const publishYamlInfor = await core.getYamlContent(filePath); |
| 121 | logger.write(`\n ${emoji('🚀')} ${publishYamlInfor['Name']}@${publishYamlInfor['Version']}: ${publishYamlInfor['Description']}\n`); |
| 122 | const commands = publishYamlInfor['Commands']; |
| 123 | if (commands) { |
| 124 | const maxLength = core.publishHelp.maxLen(commands); |
| 125 | let tmp = []; |
| 126 | const newObj = {}; |
| 127 | for (const key in commands) { |
| 128 | const ele = commands[key]; |
| 129 | isPlainObject(ele) ? tmp.push(core.publishHelp.helpInfo(ele, chalk.underline(chalk.bold(key)), maxLength, 4)) : (newObj[key] = ele); |
| 130 | } |
| 131 | tmp.length > 0 && logger.write(tmp.join('\n')); |
| 132 | if (!isEmpty(newObj)) { |
| 133 | for (const key in newObj) { |
| 134 | logger.write(` ${getTempCommandStr(key, maxLength)} ${newObj[key]}`); |
| 135 | } |
| 136 | logger.write(''); |
| 137 | } |
| 138 | logger.write(publishYamlInfor['HomePage'] ? ` ${emoji('🧭')} ${core.makeUnderLine('More information: ' + publishYamlInfor['HomePage'])} ` + '\n' : ''); |
| 139 | } |
| 140 | function getTempCommandStr(commands: string, length: number) { |
| 141 | const commandsLength = commands.length; |
| 142 | const tempArray = new Array(length - commandsLength).fill(' '); |
| 143 | return `${commands}${tempArray.join('')} : `; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | export default v1; |
no test coverage detected