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

helper: add fs #67

Merged
merged 10 commits into from
Feb 21, 2024
Merged

helper: add fs #67

merged 10 commits into from
Feb 21, 2024

Conversation

hinto-janai
Copy link
Contributor

@hinto-janai hinto-janai commented Feb 17, 2024

Adds cuprate_helper::fs for Cuprate-wide directories and files.

A OnceLock & fn() -> &'static Path combination is created for major directories. For now this PR adds:

  • cuprate_cache_dir()
  • cuprate_config_dir()
  • cuprate_data_dir()

with the standards mentioned in #46 using dirs.

@hinto-janai hinto-janai marked this pull request as ready for review February 21, 2024 02:00
@hinto-janai
Copy link
Contributor Author

Ready for review.

I would be for defining all PATHs used by Cuprate in this module, even if it's only used in 1 place.

  • We get to re-use the impl_dir_oncelock_and_fn macro
  • All definitions, tests, and documentation would be uniform and in 1 file instead of spread out everywhere

For example, cuprate_database_dir() could be defined here.

helper/src/fs.rs Outdated Show resolved Hide resolved
helper/src/fs.rs Outdated Show resolved Hide resolved
hinto-janai and others added 2 commits February 21, 2024 12:13
Co-authored-by: Boog900 <boog900@tutanota.com>
Co-authored-by: Boog900 <boog900@tutanota.com>
@Boog900 Boog900 merged commit e287ea1 into Cuprate:main Feb 21, 2024
5 checks passed
@hinto-janai hinto-janai deleted the helper branch February 21, 2024 19:39
@hinto-janai hinto-janai mentioned this pull request Feb 28, 2024
@hinto-janai hinto-janai added the A-helper Related to cuprate-helper. label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helper Related to cuprate-helper.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants