Giter Site home page Giter Site logo

winxpcn / github-release-downloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fazouane-marouane/github-release-downloader

0.0 0.0 0.0 142 KB

:fire: CLI tool to download all release assets from a git repository :fire:

Home Page: https://www.npmjs.com/package/github-release-downloader

License: MIT License

JavaScript 100.00%

github-release-downloader's Introduction

github-release-downloader

npm version Build status CircleCI license

Installation

Installing the cli tool is as easy as this:

npm install -g github-release-downloader

Simple usage

For example, to download all node-sass's binaries:

grd --token <your github api token> --owner sass --repository node-sass

To download all node-sass's binaries for versions above v4.0.0 you would do

grd --token <your github api token> --owner sass --repository node-sass --min-version v4.0.0

PS: to get a personal api token you'll need to generate one. No special right is required.

Advanced usages

1. Custom download path

By default the download path is the path from where you ran node. But it's easy to override this with the the option --output (or -o if you feel that life is too short).

grd --token <your github api token> --owner sass --repository node-sass --output local-cache

2. Parallel download

By default downloads are launched in parrallel; 3 downloads at a time. You can ofcourse specify a more appropriate number if you like:

grd --token <your github api token> --owner sass --repository node-sass --parallel 10

3. Filter assets

By default you get all assets available. No filter is applied. Let's imagine that you're only interested in linux & windows binaries. You would use --filter-asset.

grd --token <your github api token> --owner sass --repository node-sass --filter-asset '^(win32-ia32|win32-x64|linux-ia32|linux-x64)'

4. Filter versions

You have two possibilities here:

--min-version and you'd download all versions starting from the argument (this respects semver).

grd --token <your github api token> --owner sass --repository node-sass --min-version "v4.0.0"

or you can use --match-version and pass a regexp. Here are some examples

# Download only the version v4.0.0
grd --token <your github api token> --owner sass --repository node-sass --match-version "^v4\.0\.0$"

# Download only all versions v4.0.x v4.1.x v4.2.x
grd --token <your github api token> --owner sass --repository node-sass --match-version "^v4\.(0|1|2)\."

# Download all win23-x64 assets of all alpha versions since v1
grd --token <your github api token> --owner sass --repository node-sass --min-version "v1.0.0-alpha" --match-version "alpha" --filter-asset "^win32-x64"

5. Using a HTTP/HTTPS proxy

If you're behind a http/https proxy, you can also use it with grd with those parameters:

# Use the defaut proxy ($http_proxy or $https_proxy)
grd --token <your github api token> --owner sass --repository node-sass --proxy

# Use an explicit proxy
grd --token <your github api token> --owner sass --repository node-sass --proxy "https://username:password@proxy:port/"

Other types of proxies are not supported.

6. Ignore missing assets

Sometimes, GitHub releases may reference assets that are no longer available. Maybe the asset has since been deleted, but GitHub's api still references it. By default, since v1.2.0, if we the asset that we try to download is missing a warning is logged and we carry on with the other tasks. You can override this behavior if you'd prefer to raise a fatal error and stop the process by passing --no-ignore-missing-assets.

#
grd --token <your github api token> --owner sass --repository node-sass --match-version "^v4.6.1" --filter-asset "win32-ia32-45_binding.pdb" --no-ignore-missing-assets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.