mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 07:20:30 +00:00
Check is_terminal
This commit is contained in:
parent
0f4cb94cfe
commit
a7a881809f
1 changed files with 5 additions and 1 deletions
|
@ -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,
|
||||
};
|
||||
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue