Skip to content

Prefer OS Specific Paths #474

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

Merged
merged 8 commits into from
Apr 13, 2025

Conversation

catuhana
Copy link
Contributor

@catuhana catuhana commented Apr 7, 2025

Closes #470

This could be done in a better way, but for the sake of simplicity and not changing things too much, I preferred this way.

Copy link

cla-bot bot commented Apr 7, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

@catuhana
Copy link
Contributor Author

catuhana commented Apr 7, 2025

This should also fix #468 I think

@theRookieCoder
Copy link
Collaborator

theRookieCoder commented Apr 9, 2025

I was reviewing this, and I remembered that I also wanted to use the platform's recommended cache directory for downloading and extracting modpacks. I was looking up the dirs documentation, and discovered that it's actually recommended to use directories, which is higher level than dirs.

@catuhana
Copy link
Contributor Author

catuhana commented Apr 9, 2025

I was reviewing this, and I remembered that I also wanted to use the platform's recommended cache directory for downloading and extracting modpacks. I was looking up the dirs documentation, and discovered that it's actually recommended to use directories, which is higher level than dirs.

Alrighty, will do both soon today.

@catuhana
Copy link
Contributor Author

catuhana commented Apr 9, 2025

Are we sure we don't want to use /Library/Application Support/ for ferium on macOS? Having to use ~/.config for macOS kinda defeats the point of using directories, e.g. we have to do this:

#[cfg(target_os = "macos")]
{
    crate::BASE_DIRS
        .home_dir()
        .join(".config")
        .join("ferium")
        .join("config.json")
}

#[cfg(not(target_os = "macos"))]
{
    crate::PROJECT_DIRS.config_dir().join("config.json")
}

meanwhile we can only use the last block?

Also, since we'll use system cache paths now, should I rename the old

~/.config/ferium/.cache
                 ^^^^^^

and

~/.config/ferium/.tmp
                 ^^^^

to <SYSTEM_CACHE_DIR>/ferium/downloaded and <SYSTEM_CACHE_DIR>/ferium/extracted respectively? It sounds not intuitive to keep them named as is.

- Use system specific path for ferium caches too, and rename `.tmp` and `.cache` to more convenient names.
- Use system specific path for config on macOS too.
- Update documentations and README for these changes.
@theRookieCoder
Copy link
Collaborator

Are we sure we don't want to use /Library/Application Support/ for ferium on macOS?

Yeah I would really prefer using the standard *NIX ~/.config on macOS.

kinda defeats the point of using directories

Outside of Windows, one benefit of using this method is that we're now using XDG user directories on Linux.

to <SYSTEM_CACHE_DIR>/ferium/downloaded and <SYSTEM_CACHE_DIR>/ferium/extracted respectively?

Yep that would be great!

Copy link

cla-bot bot commented Apr 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

Copy link

cla-bot bot commented Apr 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

@catuhana
Copy link
Contributor Author

Ready for review.

@catuhana
Copy link
Contributor Author

Reminder to self: add to changelog after approval.

Copy link

cla-bot bot commented Apr 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

@theRookieCoder
Copy link
Collaborator

theRookieCoder commented Apr 13, 2025

I used %APPDATA% instead of %LOCALAPPDATA% because the latter is meant for large or temporary files, persistent configs should be in %APPDATA%.

Copy link

cla-bot bot commented Apr 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

Copy link

cla-bot bot commented Apr 13, 2025

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please send a signing request to cla-requests@gdlauncher.com and add your github handle to contributors list.

@theRookieCoder
Copy link
Collaborator

Thank you for the contribution!

@theRookieCoder theRookieCoder merged commit 97c1989 into gorilla-devs:main Apr 13, 2025
1 check failed
@catuhana catuhana deleted the use-windows-specific-path branch April 13, 2025 18:56
@catuhana
Copy link
Contributor Author

Seems like 9e04587 doesn't compile, just FYI in case its unnoticed.

OgGhostJelly pushed a commit to OgGhostJelly/ogj-ferium that referenced this pull request Apr 25, 2025
Co-authored-by: Ilesh Thiada <ileshkt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefer Windows Specific Path for Storing Configuration File
2 participants