other: move terminal check after the config check (#1027)

This commit is contained in:
Clement Tsang 2023-02-20 00:57:09 -05:00 committed by GitHub
parent f1f07945f6
commit 78b1126fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -39,9 +39,6 @@ fn main() -> Result<()> {
utils::logging::init_logger(log::LevelFilter::Debug, std::ffi::OsStr::new("debug.log"))?; utils::logging::init_logger(log::LevelFilter::Debug, std::ffi::OsStr::new("debug.log"))?;
} }
// Check if the current environment is in a terminal.
check_if_terminal();
// Read from config file. // Read from config file.
let config_path = read_config(matches.get_one::<String>("config_location")) let config_path = read_config(matches.get_one::<String>("config_location"))
.context("Unable to access the given config file location.")?; .context("Unable to access the given config file location.")?;
@ -72,6 +69,9 @@ fn main() -> Result<()> {
// Create painter and set colours. // Create painter and set colours.
let mut painter = canvas::Painter::init(widget_layout, colours)?; let mut painter = canvas::Painter::init(widget_layout, colours)?;
// Check if the current environment is in a terminal.
check_if_terminal();
// Create termination mutex and cvar // Create termination mutex and cvar
#[allow(clippy::mutex_atomic)] #[allow(clippy::mutex_atomic)]
let thread_termination_lock = Arc::new(Mutex::new(false)); let thread_termination_lock = Arc::new(Mutex::new(false));