(run: (dir: string) => Promise<void> | void)
| 9 | import { zipCommand } from "../src/commands/zip.js"; |
| 10 | |
| 11 | async function withTempDir(run: (dir: string) => Promise<void> | void): Promise<void> { |
| 12 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), "skillpack-zip-")); |
| 13 | try { |
| 14 | await run(dir); |
| 15 | } finally { |
| 16 | fs.rmSync(dir, { recursive: true, force: true }); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | function createPack(dir: string): void { |
| 21 | saveConfig(dir, { |