eskill 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +6 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -115,7 +115,10 @@ program
|
|
|
115
115
|
process.exit(1);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
// 从 API 返回的数据结构中提取技能和分页信息
|
|
119
|
+
const skills = result.data?.skills || result.data || result.skills || result.results || [];
|
|
120
|
+
const pagination = result.data?.pagination || result.pagination || {};
|
|
121
|
+
const total = pagination.total || result.total || skills.length;
|
|
119
122
|
|
|
120
123
|
// 确保 skills 是数组
|
|
121
124
|
if (!Array.isArray(skills)) {
|
|
@@ -127,8 +130,8 @@ program
|
|
|
127
130
|
console.log(formatSkillList(skills));
|
|
128
131
|
|
|
129
132
|
// 显示分页信息
|
|
130
|
-
if (
|
|
131
|
-
console.log(`总计: ${
|
|
133
|
+
if (total > 0) {
|
|
134
|
+
console.log(`总计: ${total} 个技能\n`);
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
// 显示安装提示
|