dirs-dev / directories-rs

a mid-level library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows
https://dirs.dev
Apache License 2.0
752 stars 33 forks source link

add `config_local_dir` (issue #68) #69

Closed ReactorScram closed 2 years ago

ReactorScram commented 2 years ago

Adds a local config dir which is identical to config_dir on Linux and Mac. On Windows it uses AppData/Local instead of AppData/Roaming.

I only ran the tests on Linux cause I don't know how CI works and I don't have a Mac / Win system handy.

soc commented 2 years ago

Hi @ReactorScram,

thanks for your PR!

Usually I'd require that the function provides behavior that is present on at least one of the supported platforms (and especially with the "local" vs. "roaming" stuff we just fill in the gaps as best as I can elsewhere).

I have to think further how/if we can make sense of this.

Cheers,

Simon

ReactorScram commented 2 years ago

So it's not normal for Windows programs to keep system-specific config in AppData/Local like this?

I also realized, this is actually a Rust implementation of the JVM directories library, right? So I can see why you wouldn't want their APIs to desync.

daxpedda commented 2 years ago

@soc friendly ping.

Currently directories offers no way to get a non-syncing config directory.

Usually I'd require that the function provides behavior that is present on at least one of the supported platforms

Is that not fulfilled? C:\Users\Alice\AppData\Local\Foo Corp\Bar App\config isn't covered by any other method but is present on Windows.

soc commented 2 years ago

@ReactorScram and @daxpedda makes sense. I will merge this and roll a new release after I come back from vacation. Thanks!

soc commented 2 years ago

Merged, thanks @ReactorScram and @daxpedda!