diff --git a/Cargo.toml b/Cargo.toml index 14f0e09..10d7b33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc" -version = "0.3.7" +version = "1.0.1" authors = ["HoolaBoola ", "Robustic ", "ShootingStar91 ", diff --git a/src/commands.rs b/src/commands.rs index 9bb0ffa..31435a9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,3 +1,4 @@ +#[cfg(target_os = "windows")] use crate::updater; use command_util::{get_organization, Client, ClientProduction}; use courses_command::list_courses; @@ -138,9 +139,11 @@ pub fn handle(matches: &clap::ArgMatches, io: &mut dyn Io) { } ("logout", _) => logout(io, &mut client), ("fetchupdate", _) => { + #[cfg(target_os = "windows")] updater::process_update(); } ("cleartemp", _) => { + #[cfg(target_os = "windows")] updater::cleartemp().unwrap(); } ("elevateddownload", _) => { diff --git a/src/main.rs b/src/main.rs index fde7301..16ecb6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,11 @@ mod cli; pub mod commands; pub mod interactive; pub mod progress_reporting; + +// Updater is used only for windows +// Updates for linux and macos are handled +// via package managers +#[cfg(target_os = "windows")] mod updater; fn main() { @@ -39,6 +44,7 @@ fn main() { 0 => { let os = std::env::consts::OS; if os == "windows" { + #[cfg(target_os = "windows")] updater::check_for_update(); } }