From 4fdee76cadbff7b3933c575cb4120b847fc0afeb Mon Sep 17 00:00:00 2001 From: Dan Cardin Date: Tue, 4 Oct 2022 14:46:42 -0400 Subject: [PATCH] fix: Inverted error handling logic for file creation. --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/output.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b37fe1..0070037 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -638,7 +638,7 @@ checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] name = "sauce" -version = "0.7.1" +version = "0.7.2" dependencies = [ "ansi_term", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index e8da886..b36c523 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sauce" -version = "0.7.1" +version = "0.7.2" authors = ["Dan Cardin "] edition = "2021" description = "A tool for managing directory-specific state." diff --git a/src/output.rs b/src/output.rs index 8ab3acd..667633a 100644 --- a/src/output.rs +++ b/src/output.rs @@ -214,7 +214,7 @@ impl Output { let created = if self.show { true } else { - std::fs::create_dir_all(parent).is_err() + std::fs::create_dir_all(parent).is_ok() }; if !created { @@ -241,7 +241,7 @@ impl Output { let created = if self.show { true } else { - std::fs::File::create(file).is_err() + std::fs::File::create(file).is_ok() }; if !created {