How to use @terascope/fetch-github-release - 1 common examples

To help you get started, we’ve selected a few @terascope/fetch-github-release examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github terascope / teraslice / packages / teraslice-cli / src / helpers / github-asset.ts View on Github external
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;
    }

@terascope/fetch-github-release

Download a specific release from github

MIT
Latest version published 14 days ago

Package Health Score

76 / 100
Full package analysis

Popular @terascope/fetch-github-release functions