summaryrefslogtreecommitdiff
path: root/src/utilities.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilities.rs')
-rw-r--r--src/utilities.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utilities.rs b/src/utilities.rs
index aa7a44e..1c2b26f 100644
--- a/src/utilities.rs
+++ b/src/utilities.rs
@@ -1,4 +1,5 @@
use std::collections::HashMap;
+use std::path::PathBuf;
pub type ConfigHashMap = HashMap<String, HashMap<String, Option<String>>>;
@@ -28,3 +29,15 @@ macro_rules! create_path_or_die {
}
};
}
+
+pub fn path_should_exist(path: &PathBuf, message: &str) {
+ if !path.exists() {
+ die!(message);
+ }
+}
+
+pub fn path_should_not_exist(path: &PathBuf, message: &str) {
+ if path.exists() {
+ die!(message);
+ }
+}