cargo-unmaintained 2.0.2

Find unmaintained packages in Rust projects
Documentation
use elaborate::std::{env::var_wc, fs::write_wc};
use std::path::PathBuf;

const TOKEN_PATH: &str = if cfg!(not(windows)) {
    "$HOME/.config/cargo-unmaintained/token.txt"
} else {
    "%LOCALAPPDATA%\\\\cargo-unmaintained\\\\token.txt"
};

fn main() {
    println!("cargo:rustc-cfg=__warnings");

    #[cfg(all(feature = "crates-index", feature = "tame-index"))]
    println!(
        "cargo:warning=Both `crates-index` and `tame-index` features are enabled; using \
         `tame-index`"
    );

    let out_dir = var_wc("OUT_DIR").unwrap();
    let path_buf = PathBuf::from(out_dir).join("after_help.rs");
    let contents = format!(
        r#"const AFTER_HELP: &str = "\
The `GITHUB_TOKEN_PATH` environment variable can be set to the path of a file containing a \
personal access token. If set, cargo-unmaintained will use this token to authenticate to GitHub \
and check whether packages' repositories have been archived.

Alternatively, the `GITHUB_TOKEN` environment variable can be set to a personal access token. \
However, use of `GITHUB_TOKEN_PATH` is recommended as it is less likely to leak the token.

If neither `GITHUB_TOKEN_PATH` nor `GITHUB_TOKEN` is set, but a file exists at {TOKEN_PATH}, \
cargo-unmaintained will use that file's contents as a personal access token.

Unless --no-exit-code is passed, the exit status is 0 if no unmaintained packages were found and \
no irrecoverable errors occurred, 1 if unmaintained packages were found, and 2 if an irrecoverable \
error occurred.";
"#,
    );
    write_wc(path_buf, contents).unwrap();
}