Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (version) {
filterRelease = (r: any) => !r.draft && !r.prerelease && r.tag_name.includes(version);
} else {
filterRelease = (r: any) => !r.draft && !r.prerelease;
}
const genFilterAsset = (asset: any) => asset.name.indexOf(assetName) >= 0;
try {
await fs.ensureDir(outDir);
} catch (err) {
throw new TSError(`Error creating ${outDir}: ${err}`);
}
try {
const r = await downloadRelease(
this.user,
this.name,
outDir,
// @ts-ignore TODO: need to fix types in forked repo
filterRelease,
genFilterAsset,
leaveZipped,
quiet
);
[assetPath] = r;
} catch (err) {
throw new Error(`Error downloading ${this.assetString}: ${err}`);
}
return assetPath;
}