Skip to content

Commit 0c82a7c

Browse files
committed
Fixes for Windows tools
1 parent 4d80d69 commit 0c82a7c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/bin/thag_mintty_add_theme.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use thag_styling::{auto_help, help_system::check_help_and_exit};
2828
#[cfg(target_os = "windows")]
2929
file_navigator! {}
3030

31+
#[cfg(target_os = "windows")]
3132
#[allow(clippy::too_many_lines)]
3233
fn main() -> Result<(), Box<dyn Error>> {
3334
// Check for help first - automatically extracts from source comments
@@ -470,6 +471,12 @@ fn show_usage_instructions() {
470471
println!(" Existing windows may need to be restarted to see the changes.");
471472
}
472473

474+
#[cfg(not(target_os = "windows"))]
475+
fn main() {
476+
eprintln!("This tool is only available on Windows.");
477+
std::process::exit(1);
478+
}
479+
473480
#[cfg(test)]
474481
mod tests {
475482
#[cfg(target_os = "windows")]

src/bin/thag_winterm_add_theme.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ thag_styling = { version = "0.2, thag-auto", features = ["inquire_theming"] }
1212
//# Categories: color, styling, terminal, theming, tools, windows
1313
#[cfg(target_os = "windows")]
1414
use inquire::set_global_render_config;
15+
1516
#[cfg(target_os = "windows")]
1617
use std::{
1718
error::Error,
@@ -27,6 +28,7 @@ use thag_styling::{auto_help, help_system::check_help_and_exit};
2728
#[cfg(target_os = "windows")]
2829
file_navigator! {}
2930

31+
#[cfg(target_os = "windows")]
3032
fn main() -> Result<(), Box<dyn Error>> {
3133
// Check for help first - automatically extracts from source comments
3234
let help = auto_help!();
@@ -678,6 +680,12 @@ fn show_usage_instructions(added_schemes: &[(String, String)]) {
678680
// })
679681
// }
680682

683+
#[cfg(not(target_os = "windows"))]
684+
fn main() {
685+
eprintln!("This tool is only available on Windows.");
686+
std::process::exit(1);
687+
}
688+
681689
#[cfg(test)]
682690
mod tests {
683691

0 commit comments

Comments
 (0)