code-workspace-zhuiyi 0.1.0-beta.1 → 0.1.0-beta.2
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/artifacts/manifest.json
CHANGED
|
@@ -185,12 +185,16 @@ function download(url, file, options, redirects = 0) {
|
|
|
185
185
|
|
|
186
186
|
async function prepareRelease(release, outputRoot, options = {}) {
|
|
187
187
|
const archiveFile = path.join(path.dirname(outputRoot), "zhuiyi-jira-mcp.tar.gz");
|
|
188
|
-
const downloaded = options.downloaded || await download(release.url, archiveFile, release);
|
|
189
|
-
if (downloaded.sha256 !== release.sha256) throw archiveError("JIRA_ARCHIVE_HASH_MISMATCH", `Archive hash mismatch for ${release.url}`, { url: release.url, expectedSha256: release.sha256, actualSha256: downloaded.sha256 });
|
|
190
188
|
const source = options.archiveFile || archiveFile;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
try {
|
|
190
|
+
const downloaded = options.downloaded || await download(release.url, archiveFile, release);
|
|
191
|
+
if (downloaded.sha256 !== release.sha256) throw archiveError("JIRA_ARCHIVE_HASH_MISMATCH", `Archive hash mismatch for ${release.url}`, { url: release.url, expectedSha256: release.sha256, actualSha256: downloaded.sha256 });
|
|
192
|
+
const extracted = extractTarGz(source, outputRoot, release);
|
|
193
|
+
validatePackage(outputRoot, release);
|
|
194
|
+
return { ...downloaded, ...extracted };
|
|
195
|
+
} finally {
|
|
196
|
+
if (!options.archiveFile) fs.rmSync(archiveFile, { force: true });
|
|
197
|
+
}
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
module.exports = { archiveError, download, extractTarGz, prepareRelease, safeRelativePath, validatePackage };
|