Tags: DreamsHive/cloakmail-cli
Tags
v1.0.2
Bug fix: Windows setup no longer fails at the tarball extraction step.
The `setup` command shelled out to `tar` by embedding the archive path
in a command string (`system.exec(\`tar -xzf "${path}" ...\`)`). On
Windows this ran through `cmd /c`, whose quote-parsing rules preserved
the inner `"` characters and passed them to `tar` as part of the
filename — producing the error:
tar: Error opening archive: Failed to open '"C:\...\cloakmail-v1.1.0.tar.gz"'
The fix replaces the shell-string invocation with a direct
`spawn("tar", ["-xzf", archive, "-C", dest])` call. Argv entries go
straight to the OS with no shell parsing, so paths containing
backslashes or spaces reach `tar` verbatim.
The new `extractTarballToDir` helper also normalizes all failure shapes
(non-zero exit, signal termination, ENOENT, generic spawn error) into
`AcquireError` with specific user-facing messages.
Closes DreamsHive/cloakmail#5
What changed:
- src/extensions/source.ts — replaced system.exec tar call with
argv-based spawn; added extractTarballToDir helper
- tests/source.test.ts — 6 regression tests via mocked spawn seam
- package.json — version 1.0.1 → 1.0.2