/crate_downloader

Download Rust crates for offline development

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

crate_downloader

Download rust crates for offline development.

Overview

This is a small app that downloads Rust crates for offline development.

  • Uses reqwest for http client requests
  • Uses structopt to define and parse command line arguments
  • Downloads are streamed via concurrent, asynchronous requests (via futures)

Setup

# Clone this repo
git clone https://github.com/jarri2di/crate_downloader.git

# Clone the crates index repo
git clone https://github.com/rust-lang/crates.io-index.git

# Create a directory for downloaded crates
mkdir -p /path/to/local/crates

Usage

cargo run -- --help

Check and lint

Install clippy.

cargo check

cargo clippy

Run

RUST_LOG=info cargo run -- -i /path/to/local/crates.io-index -d /path/to/local/crates

Build

cargo build --release

Run executable

RUST_LOG=info ./target/release/crate_downloader -i /path/to/local/crates.io-index -d /path/to/local/crates