skill-os 0.1.2 → 0.1.3

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/package.json +1 -1
  2. package/skill-os.js +15 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-os",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Skill-OS CLI for managing OS skills",
5
5
  "main": "skill-os.js",
6
6
  "bin": {
package/skill-os.js CHANGED
@@ -346,13 +346,23 @@ function cmdDownload(skillPath, options) {
346
346
  console.log(` Target: ${chalk.cyan(targetDir)}\n`);
347
347
 
348
348
  try {
349
- // Stream the curl output directly into tar to extract the directory structure
350
- // -s: silent curl, -L: follow redirects
351
- // tar -xzf -: extract gzipped tar from stdin
352
- execSync(`curl -s -L "${downloadUrl}" | tar -xzf -`, { cwd: targetDir, stdio: 'inherit' });
349
+ const tmpZip = path.join(require('os').tmpdir(), `skill-${Date.now()}.zip`);
350
+
351
+ // Download the zip file to OS tmp dir
352
+ execSync(`curl -s -L -o "${tmpZip}" "${downloadUrl}"`);
353
+
354
+ // Extract the zip to target directory
355
+ // -q: quiet, -o: overwrite
356
+ execSync(`unzip -q -o "${tmpZip}" -d "${targetDir}"`);
357
+
358
+ // Cleanup temp file
359
+ if (fs.existsSync(tmpZip)) {
360
+ fs.unlinkSync(tmpZip);
361
+ }
362
+
353
363
  console.log(`\n${chalk.green(`✓ Successfully downloaded and extracted to: ${targetDir}`)}`);
354
364
  } catch (e) {
355
- console.error(`\n${chalk.red(`✗ Failed to download. The API may have returned an error instead of a tarball.`)}`);
365
+ console.error(`\n${chalk.red(`✗ Failed to download. The API may have returned an error, or 'unzip' is not installed.`)}`);
356
366
  process.exit(1);
357
367
  }
358
368
  }