harmonyos-skills-pack 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/bin/cli.js +8 -2
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -13,7 +13,7 @@
13
13
  * npx harmonyos-skills-pack --claude-only # 仅安装 .claude/skills
14
14
  */
15
15
 
16
- const { execSync } = require('child_process');
16
+ const { execSync, execFileSync } = require('child_process');
17
17
  const fs = require('fs');
18
18
  const path = require('path');
19
19
  const os = require('os');
@@ -134,10 +134,16 @@ try {
134
134
  const label = url.includes('ghproxy') ? '国内镜像' : 'GitHub';
135
135
  console.log(` 📥 ${i > 0 ? '回退到 ' : ''}下载 (${label})`);
136
136
  try {
137
- execSync(`curl -sL --connect-timeout 10 "${url}" | tar -xz -C "${tmpDir}"`, {
137
+ const archivePath = path.join(tmpDir, 'archive.tar.gz');
138
+ execFileSync('curl', ['-sL', '--connect-timeout', '10', '-o', archivePath, url], {
138
139
  stdio: ['pipe', 'pipe', 'pipe'],
139
140
  timeout: 60000,
140
141
  });
142
+ execFileSync('tar', ['-xzf', archivePath, '-C', tmpDir], {
143
+ stdio: ['pipe', 'pipe', 'pipe'],
144
+ timeout: 30000,
145
+ });
146
+ fs.unlinkSync(archivePath);
141
147
  downloaded = true;
142
148
  break;
143
149
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harmonyos-skills-pack",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "一键安装鸿蒙 Ark 开发文档 + 通用产品质量 skills pack,适配 Claude/Copilot/Codex Agent",
5
5
  "keywords": [
6
6
  "harmonyos",