Skip to content

Commit

Permalink
🚑 Try fixing incorrect boot path.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Mar 31, 2024
1 parent 7f16e06 commit 2d65547
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/database/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub static WEBSITE_RES_DIR: Lazy<PathBuf> = Lazy::new(|| {
pub static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
let mut path = std::env::var("ROOT_DIR")
.ok()
.map(|dir| Path::new(&dir).to_path_buf())
.map(|dir| Path::new(&dir).to_path_buf().join("cache"))
.unwrap_or(std::env::current_dir().unwrap().join("cache"));
// If directory does not exist, create it
if !path.exists() {
Expand All @@ -38,7 +38,7 @@ pub static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
pub static MEDIA_DIR: Lazy<PathBuf> = Lazy::new(|| {
let mut path = std::env::var("ROOT_DIR")
.ok()
.map(|dir| Path::new(&dir).to_path_buf())
.map(|dir| Path::new(&dir).to_path_buf().join("cache"))
.unwrap_or(std::env::current_dir().unwrap().join("cache"));
path.push("media");

Expand All @@ -51,7 +51,7 @@ pub static MEDIA_DIR: Lazy<PathBuf> = Lazy::new(|| {
pub static MEDIA_CACHE_DIR: Lazy<PathBuf> = Lazy::new(|| {
let mut path = std::env::var("ROOT_DIR")
.ok()
.map(|dir| Path::new(&dir).to_path_buf())
.map(|dir| Path::new(&dir).to_path_buf().join("cache"))
.unwrap_or(std::env::current_dir().unwrap().join("cache"));
path.push("media-cache");

Expand All @@ -64,7 +64,7 @@ pub static MEDIA_CACHE_DIR: Lazy<PathBuf> = Lazy::new(|| {
pub static DATABASE_DIR: Lazy<PathBuf> = Lazy::new(|| {
let mut path = std::env::var("ROOT_DIR")
.ok()
.map(|dir| Path::new(&dir).to_path_buf())
.map(|dir| Path::new(&dir).to_path_buf().join("cache"))
.unwrap_or(std::env::current_dir().unwrap().join("cache"));
path.push("database");

Expand All @@ -77,7 +77,7 @@ pub static DATABASE_DIR: Lazy<PathBuf> = Lazy::new(|| {
pub static LOG_DIR: Lazy<PathBuf> = Lazy::new(|| {
let mut path = std::env::var("ROOT_DIR")
.ok()
.map(|dir| Path::new(&dir).to_path_buf())
.map(|dir| Path::new(&dir).to_path_buf().join("cache"))
.unwrap_or(std::env::current_dir().unwrap().join("cache"));
path.push("log");

Expand Down

0 comments on commit 2d65547

Please sign in to comment.