Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default dir to be based off of $HOME #236

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("tide-disco/public/media");
let path = PathBuf::from("$HOME/tide-disco/public/media");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So $HOME get's expanded here? Neat!

I would make it a dotfile (~/.tide-disco/) so we aren't cluttering up people's home directories

// 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();
Expand Down
Loading