From 0d5469b66a34f0b52cbcd120cd7a608e43d71b30 Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 19 Sep 2024 15:56:56 -0400 Subject: [PATCH 1/3] change public to be function of homedir --- src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index c14ce4e..5b25e96 100644 --- a/src/app.rs +++ b/src/app.rs @@ -274,7 +274,7 @@ lazy_static! { // system and return the path to that directory. let path = dirs::data_local_dir() .unwrap_or_else(|| env::current_dir().unwrap_or_else(|_| PathBuf::from("./"))) - .join("tide-disco/public/media"); + .join("$HOME/tide-disco/public/media"); // If the path already exists, move it aside so we can update it. let _ = fs::rename(&path, path.with_extension("old")); DEFAULT_PUBLIC_DIR.extract(&path).unwrap(); From cb98e993f6a9a351c8ec00de944284fc3151f48b Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 19 Sep 2024 16:31:59 -0400 Subject: [PATCH 2/3] move to tmp --- src/app.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app.rs b/src/app.rs index 5b25e96..9215dc5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -272,9 +272,7 @@ lazy_static! { // The contents of the default public directory are included in the binary. The first time // the default directory is used, if ever, we extract them to a directory on the host file // system and return the path to that directory. - let path = dirs::data_local_dir() - .unwrap_or_else(|| env::current_dir().unwrap_or_else(|_| PathBuf::from("./"))) - .join("$HOME/tide-disco/public/media"); + let path = PathBuf::from("/tmp/tide-disco/public/media"); // If the path already exists, move it aside so we can update it. let _ = fs::rename(&path, path.with_extension("old")); DEFAULT_PUBLIC_DIR.extract(&path).unwrap(); From 385c7ba6f1b9a97c9a39a046ea5cd1f5e90a506d Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 19 Sep 2024 16:34:39 -0400 Subject: [PATCH 3/3] to home --- src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 9215dc5..9cb4170 100644 --- a/src/app.rs +++ b/src/app.rs @@ -272,7 +272,7 @@ lazy_static! { // The contents of the default public directory are included in the binary. The first time // the default directory is used, if ever, we extract them to a directory on the host file // system and return the path to that directory. - let path = PathBuf::from("/tmp/tide-disco/public/media"); + let path = PathBuf::from("$HOME/tide-disco/public/media"); // If the path already exists, move it aside so we can update it. let _ = fs::rename(&path, path.with_extension("old")); DEFAULT_PUBLIC_DIR.extract(&path).unwrap();