|
1 | | -/* |
2 | | - * MIT License |
3 | | - * |
4 | | - * Copyright (c) 2022 anqiansong |
5 | | - * |
6 | | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | | - * of this software and associated documentation files (the "Software"), to deal |
8 | | - * in the Software without restriction, including without limitation the rights |
9 | | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 | | - * copies of the Software, and to permit persons to whom the Software is |
11 | | - * furnished to do so, subject to the following conditions: |
12 | | - * |
13 | | - * The above copyright notice and this permission notice shall be included in all |
14 | | - * copies or substantial portions of the Software. |
15 | | - * |
16 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 | | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
20 | | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
21 | | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
22 | | - * SOFTWARE. |
23 | | - */ |
| 1 | +// MIT License |
| 2 | +// |
| 3 | +// Copyright (c) 2022 anqiansong |
| 4 | +// |
| 5 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | +// of this software and associated documentation files (the "Software"), to deal |
| 7 | +// in the Software without restriction, including without limitation the rights |
| 8 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | +// copies of the Software, and to permit persons to whom the Software is |
| 10 | +// furnished to do so, subject to the following conditions: |
| 11 | +// |
| 12 | +// The above copyright notice and this permission notice shall be included in all |
| 13 | +// copies or substantial portions of the Software. |
| 14 | +// |
| 15 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | +// SOFTWARE. |
24 | 22 |
|
25 | 23 | package cmd |
26 | 24 |
|
@@ -115,29 +113,28 @@ var emojiMap = map[string]string{ |
115 | 113 | "language": "🌎 ", |
116 | 114 | "license": "📌 ", |
117 | 115 | "age": "⏰ ", |
118 | | - "stars": "🌟 ", |
| 116 | + "starCount": "🌟 ", |
119 | 117 | "latestDayStarCount": "📊 ", |
120 | 118 | "latestWeekStarCount": "📉 ", |
121 | 119 | "latestMonthStarCount": "📈 ", |
122 | | - "forks": "👏 ", |
123 | | - "watchers": "👀 ", |
124 | | - "issues": "💪 ", |
125 | | - "pull requests": "💯 ", |
126 | | - "contributors": "👥 ", |
127 | | - "releases": "🚀 ", |
128 | | - "release circle(avg)": "🔭 ", |
129 | | - "lastRelease": "🎯 ", |
130 | | - "lastCommit": "🕦 ", |
131 | | - "lastUpdate": "📝 ", |
| 120 | + "forkCount": "👏 ", |
| 121 | + "watcherCount": "👀 ", |
| 122 | + "issue": "💪 ", |
| 123 | + "pull": "💯 ", |
| 124 | + "contributorCount": "👥 ", |
| 125 | + "releaseCount": "🚀 ", |
| 126 | + "avgReleasePeriod": "🔭 ", |
| 127 | + "latestReleaseAt": "🎯 ", |
| 128 | + "lastPushedAt": "🕦 ", |
| 129 | + "lastUpdatedAt": "📝 ", |
132 | 130 | } |
133 | 131 |
|
134 | 132 | func createRow(title string, field string, emoji bool, data ...*viper.Viper) table.Row { |
| 133 | + if emoji { |
| 134 | + title = emojiMap[field] + title |
| 135 | + } |
135 | 136 | ret := table.Row{title} |
136 | 137 | for _, e := range data { |
137 | | - title := fmt.Sprintf("%v", e.Get(field)) |
138 | | - if emoji { |
139 | | - title += emojiMap[field] |
140 | | - } |
141 | 138 | ret = append(ret, e.Get(field)) |
142 | 139 | } |
143 | 140 | return ret |
|
0 commit comments