Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload OS information #46

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env;
use std::io::Write;
use std::time::{SystemTime, UNIX_EPOCH};

Expand Down Expand Up @@ -171,6 +172,7 @@ async fn run_upload(upload_args: UploadArgs, test_command: Option<String>) -> an
}

let envs = EnvScanner::scan_env();
let os_info: String = env::consts::OS.to_string();
let meta = BundleMeta {
version: META_VERSION.to_string(),
cli_version: format!(
Expand All @@ -186,6 +188,7 @@ async fn run_upload(upload_args: UploadArgs, test_command: Option<String>) -> an
envs,
upload_time_epoch: SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs(),
test_command,
os_info: Some(os_info),
};

log::info!("Total files pack and upload: {}", file_counter.get_count());
Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub struct BundleMeta {
pub envs: std::collections::HashMap<String, String>,
pub upload_time_epoch: u64,
pub test_command: Option<String>,
pub os_info: Option<String>,
}

#[cfg(test)]
Expand Down