@swimlane/cosign
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -40,22 +40,27 @@ "use strict"; | ||
return new Promise(async (resolve, reject) => { | ||
const tempDir = await temp_1.default.mkdir(); | ||
const args = [ | ||
"save", | ||
"--dir", | ||
tempDir, | ||
repository | ||
]; | ||
const result = await (0, execa_1.default)(binFile, args, {}); | ||
if (result.exitCode !== 0) { | ||
throw new Error("cosign save failed"); | ||
try { | ||
const tempDir = await temp_1.default.mkdir(); | ||
const args = [ | ||
"save", | ||
"--dir", | ||
tempDir, | ||
repository | ||
]; | ||
const result = await (0, execa_1.default)(binFile, args, {}); | ||
if (result.exitCode !== 0) { | ||
throw new Error("cosign save failed"); | ||
} | ||
const archive = (0, archiver_1.create)("tar", { gzip: true }); | ||
archive.glob("**", { | ||
cwd: tempDir | ||
}); | ||
archive | ||
.pipe(writable) | ||
.on("finish", resolve) | ||
.on("error", reject); | ||
await archive.finalize(); | ||
} | ||
const archive = (0, archiver_1.create)("tar", { gzip: true }); | ||
archive.glob("**", { | ||
cwd: tempDir | ||
}); | ||
archive | ||
.pipe(writable) | ||
.on("finish", resolve) | ||
.on("error", reject); | ||
await archive.finalize(); | ||
catch (error) { | ||
reject(error); | ||
} | ||
}); | ||
@@ -62,0 +67,0 @@ }; |
{ | ||
"name": "@swimlane/cosign", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -15,3 +15,4 @@ "main": "./lib/index.js", | ||
"prepack": "yarn build", | ||
"pack:local": "npm pack" | ||
"pack:local": "npm pack", | ||
"release:canary": "yarn version --prerelease && yarn publish" | ||
}, | ||
@@ -34,4 +35,4 @@ "keywords": [], | ||
"devDependencies": { | ||
"@commitlint/cli": "17.0.2", | ||
"@commitlint/config-conventional": "17.0.2", | ||
"@commitlint/cli": "17.0.3", | ||
"@commitlint/config-conventional": "17.0.3", | ||
"@types/archiver": "5.3.1", | ||
@@ -41,5 +42,5 @@ "@types/fs-extra": "9.0.13", | ||
"@types/temp": "0.9.1", | ||
"concurrently": "7.2.2", | ||
"concurrently": "7.3.0", | ||
"copyfiles": "2.4.1", | ||
"eslint": "8.16.0", | ||
"eslint": "8.20.0", | ||
"eslint-config-prettier": "8.5.0", | ||
@@ -46,0 +47,0 @@ "eslint-plugin-prettier": "4.2.1", |
@@ -22,29 +22,35 @@ import path, { join, resolve } from "node:path"; | ||
return new Promise<void>(async (resolve, reject) => { | ||
const tempDir = await temp.mkdir(); | ||
const args = [ | ||
"save", | ||
"--dir", | ||
tempDir, | ||
repository]; | ||
try { | ||
const tempDir = await temp.mkdir(); | ||
const result = await execa(binFile, args, {}); | ||
const args = [ | ||
"save", | ||
"--dir", | ||
tempDir, | ||
repository]; | ||
if (result.exitCode !== 0) { | ||
throw new Error("cosign save failed"); | ||
} | ||
const result = await execa(binFile, args, {}); | ||
const archive = create("tar", { gzip: true }); | ||
if (result.exitCode !== 0) { | ||
throw new Error("cosign save failed"); | ||
} | ||
archive.glob("**", { | ||
cwd: tempDir | ||
}); | ||
const archive = create("tar", { gzip: true }); | ||
archive | ||
.pipe(writable) | ||
.on("finish", resolve) | ||
.on("error", reject); | ||
archive.glob("**", { | ||
cwd: tempDir | ||
}); | ||
archive | ||
.pipe(writable) | ||
.on("finish", resolve) | ||
.on("error", reject); | ||
await archive.finalize(); | ||
await archive.finalize(); | ||
} | ||
catch(error){ | ||
reject(error) | ||
} | ||
}); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38
390
25919