cli icon indicating copy to clipboard operation
cli copied to clipboard

Consider `dirs` crate for better cross-platform support

Open maxrake opened this issue 1 year ago • 2 comments

Consider better cross-platform support by creating/saving/updating the settings.yaml file in a more natural location for the OS. This can be accomplished with the dirs crate from crates.io. Currently, a local crate with the same name is used - cli/src/dirs.rs - and assumes Linux for the default location.

References:

maxrake avatar Oct 02 '24 14:10 maxrake

The dirs crate was considered when moved files out of ~/.phylum.

The crate uses locations that are technically correct for each OS, but that means using the very unnatural $HOME/Library/Application Support on macOS...

Since the only concern with our current code is Windows, it probably makes more sense to update our code to use AppData on Windows rather than switching to the dirs crate for everything.

kylewillmon avatar Oct 02 '24 16:10 kylewillmon

Reminder for possible later phylum-ci update: there is a Python package, platformdirs, that does the same thing as the dirs crate.

maxrake avatar Oct 07 '24 14:10 maxrake