Skip to content

Simple Rust build.rs utils for fetching and unrolling .tar.gz archives

Notifications You must be signed in to change notification settings

katyo/fetch_unroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple fetch and unroll .tar.gz archives

License: Apache-2.0 Crates.io Package Docs.rs API Docs Travis-CI Status

Simple functions intended to use in Rust build.rs scripts for tasks which related to fetching from HTTP and unrolling .tar.gz archives with precompiled binaries and etc.

Usage example

use fetch_unroll::Fetch;

let pack_url = format!(
    concat!("{base}/{user}/{repo}/releases/download/",
            "{package}-{version}/{package}_{target}_{profile}.tar.gz"),
    base = "https://github.com",
    user = "katyo",
    repo = "aubio-rs",
    package = "libaubio",
    version = "0.5.0-alpha",
    target = "armv7-linux-androideabi",
    profile = "debug",
);

let dest_dir = "target/test_download";

// Fetching and unrolling archive
Fetch::from(pack_url)
    .unroll().strip_components(1).to(dest_dir)
    .unwrap();

About

Simple Rust build.rs utils for fetching and unrolling .tar.gz archives

Resources

Stars

Watchers

Forks

Packages

No packages published