Skip to content

Commit

Permalink
Check is_terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Jul 8, 2024
1 parent 0f4cb94 commit a7a8818
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::{bail, Context, Result};
use app_state::StateFileStatus;
use clap::{Parser, Subcommand};
use std::{
io::{self, BufRead, StdoutLock, Write},
io::{self, BufRead, IsTerminal, StdoutLock, Write},
path::Path,
process::exit,
};
Expand Down Expand Up @@ -148,6 +148,10 @@ fn main() -> Result<()> {

match args.command {
None => {
if !io::stdout().is_terminal() {
bail!("Unsupported or missing terminal/TTY");
}

let notify_exercise_names = if args.manual_run {
None
} else {
Expand Down

0 comments on commit a7a8818

Please sign in to comment.