Skip to content

Commit faf6d03

Browse files
committed
Check if asset exists
1 parent 9c1bbfe commit faf6d03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

script/release

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const zipAsset = (asset) => {
2020
const assetBase = path.basename(asset.path)
2121
const assetDirectory = path.dirname(asset.path)
2222
console.log(`Zipping ${assetBase} to ${asset.name}`)
23+
24+
if (!fs.existsSync(asset.path)) {
25+
return reject(new Error(`${asset.path} does not exist`))
26+
}
27+
2328
const zipCommand = `zip --recurse-paths --symlinks '${asset.name}' '${assetBase}'`
2429
const options = {cwd: assetDirectory, maxBuffer: Infinity}
2530
childProcess.exec(zipCommand, options, (error) => {

0 commit comments

Comments
 (0)