allow to supress the warning about old database version
This commit is contained in:
parent
5dd87616f8
commit
615caab92a
|
@ -72,6 +72,7 @@ pub fn time_or_warning<D: Database>(time: DateTime<Utc>, db: &D) -> Result<(Date
|
|||
/// emits the appropiate warning if the old database format was detected.
|
||||
pub fn warn_if_needed<E: Write>(err: &mut E, needs_warning: bool) -> Result<()> {
|
||||
if needs_warning {
|
||||
if std::env::var_os("TIEMPO_SUPRESS_TIMETRAP_WARNING").is_none() {
|
||||
writeln!(
|
||||
err,
|
||||
"{} You are using the old timetrap format, it is advised that \
|
||||
|
@ -79,6 +80,7 @@ pub fn warn_if_needed<E: Write>(err: &mut E, needs_warning: bool) -> Result<()>
|
|||
Yellow.bold().paint("[WARNING]"),
|
||||
).map_err(|e| IOError(e))?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue