libpkgx 0.7.0

Install and run `pkgx` packages
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::env;

fn main() {
    let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();

    let dist_url = if target_os == "windows" {
        option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev/v2")
    } else {
        option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev")
    };

    let default_pantry_tarball_filename = "pantry.tar.xz";
    let pantry_url =
        option_env!("PKGX_PANTRY_TARBALL_FILENAME").unwrap_or(default_pantry_tarball_filename);

    println!("cargo:rustc-env=PKGX_DIST_URL={dist_url}");
    println!("cargo:rustc-env=PKGX_PANTRY_TARBALL_FILENAME={pantry_url}");
}