Constant pages::GIT_COMMIT_HASH [−][src]
pub const GIT_COMMIT_HASH: &str = "c6f9cb7ac1d7e9a4b945cae402686383608bc71d";
diff --git a/pages/constant.GIT_COMMIT_HASH.html b/pages/constant.GIT_COMMIT_HASH.html index 32d1ad0..c526aa6 100644 --- a/pages/constant.GIT_COMMIT_HASH.html +++ b/pages/constant.GIT_COMMIT_HASH.html @@ -1,4 +1,4 @@
pub const GIT_COMMIT_HASH: &str = "c6f9cb7ac1d7e9a4b945cae402686383608bc71d";
pub const GIT_COMMIT_HASH: &str = "fc8f86a2af00e3bb6d060b01cd9948e0ee88f157";
server: Server
source_code: String
pages: Vec<Page>
Returns a copy of the value. Read more
+}server: Server
source_code: String
pages: Vec<Page>
Deserialize this value from the given Serde deserializer. Read more
diff --git a/pages/struct.SETTINGS.html b/pages/struct.SETTINGS.html index fde0afd..163773d 100644 --- a/pages/struct.SETTINGS.html +++ b/pages/struct.SETTINGS.html @@ -2,7 +2,7 @@pub struct SETTINGS {
pub(crate) __private_field: (),
-}
__private_field: ()
The resulting type after dereferencing.
+}__private_field: ()
Immutably borrows from an owned value. Read more
diff --git a/pages/struct.Settings.html b/pages/struct.Settings.html index a444aed..b5960a2 100644 --- a/pages/struct.Settings.html +++ b/pages/struct.Settings.html @@ -4,7 +4,7 @@ pub server: Server, pub source_code: String, pub pages: Vec<Page>, -}server: Server
source_code: String
pages: Vec<Page>
Returns a copy of the value. Read more
+}server: Server
source_code: String
pages: Vec<Page>
Deserialize this value from the given Serde deserializer. Read more
diff --git a/src/pages/settings.rs.html b/src/pages/settings.rs.html index 2c1b806..52a9864 100644 --- a/src/pages/settings.rs.html +++ b/src/pages/settings.rs.html @@ -107,6 +107,16 @@ 105 106 107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117/*
* Copyright (C) 2022 Aravinth Manivannan <realaravinth@batsense.net>
*
@@ -162,14 +172,24 @@
const CURRENT_DIR: &str = "./config/default.toml";
const ETC: &str = "/etc/static-pages/config.toml";
- if let Ok(path) = env::var("PAGES__CONFIG") {
- s = s.add_source(File::with_name(&path));
- } else if Path::new(CURRENT_DIR).exists() {
+ let mut read_file = false;
+
+ if Path::new(ETC).exists() {
+ s = s.add_source(File::with_name(ETC));
+ read_file = true;
+ }
+ if Path::new(CURRENT_DIR).exists() {
// merging default config from file
s = s.add_source(File::with_name(CURRENT_DIR));
- } else if Path::new(ETC).exists() {
- s = s.add_source(File::with_name(ETC));
- } else {
+ read_file = true;
+ }
+
+ if let Ok(path) = env::var("PAGES_CONFIG") {
+ s = s.add_source(File::with_name(&path));
+ read_file = true;
+ }
+
+ if !read_file {
log::warn!("configuration file not found");
}