Commit 348bedb5 authored by Nugine's avatar Nugine
Browse files

feat(s3s-test/build): add profile

parent b57ee574
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
use std::env;
use std::process::Command;

pub fn collect_info() {
@@ -10,6 +11,9 @@ pub fn collect_info() {
    if let Some(tag) = git_tag() {
        println!("cargo:rustc-env=S3S_GIT_TAG={tag}");
    }
    if let Ok(val) = env::var("PROFILE") {
        println!("cargo:rustc-env=S3S_PROFILE={val}");
    }
}

#[must_use]
+9 −1
Original line number Diff line number Diff line
@@ -177,7 +177,15 @@ macro_rules! main {
            const GIT_COMMIT: &str = unwrap(option_env!("S3S_GIT_COMMIT"), "-");
            const GIT_BRANCH: &str = unwrap(option_env!("S3S_GIT_BRANCH"), "-");
            const GIT_TAG: &str = unwrap(option_env!("S3S_GIT_TAG"), "-");
            const_str::format!("{}\nbranch: {}\ncommit: {}\ntag: {}", PKG_VERSION, GIT_BRANCH, GIT_COMMIT, GIT_TAG)
            const PROFILE: &str = unwrap(option_env!("S3S_PROFILE"), "-");
            const_str::format!(
                "{}\nbranch: {}\ncommit: {}\ntag: {}\nprofile: {}",
                PKG_VERSION,
                GIT_BRANCH,
                GIT_COMMIT,
                GIT_TAG,
                PROFILE
            )
        };

        #[derive(Debug, clap::Parser)]