Code Monkey home page Code Monkey logo

configdir's People

Contributors

emersion avatar petemoore avatar shibukawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

configdir's Issues

Add ability to set default permission like umask

Config files sometimes contain secret data. In this case it would nice to predefine the file and folder permission. Something similar to umask.
In addition the package could provide a function that checks and fixes the permission.

Addition of confined level

Currently using this lib to build a snap compatible command line tool and while declaring the snap plugs for personal-files I found that it does not consider those paths.

Output of QueryFolders() on an unconfined binary:

/home/adrian/.config/pushover-cli
/etc/xdg/xdg-plasma/pushover-cli
/etc/xdg/pushover-cli
/usr/share/kubuntu-default-settings/kf5-settings/pushover-cli

which is fine. As soon as I use the same method inside a snapped binary:

/home/adrian/snap/pushover-cli/x1/.config/pushover-cli
/etc/xdg/xdg-plasma/pushover-cli
/etc/xdg/pushover-cli
/usr/share/kubuntu-default-settings/kf5-settings/pushover-cli

After I connect the personal-files interface on my snap it still does not consider $HOME/.config a valid directory.

Maybe it could consider /home/$USER as a possible location on linux, even if $HOME is present, as those two can differ in a confined deployment.

I cant use LocalPath as the order is mixed. If I read or write a config, I prefer $HOME/.config over $HOME/snap/ and only if write access to former is not possible, I want to write to $HOME/snap. That does not mean that it should not detect a possible read-only config file in $HOME/.config.

Any idea how to handle this gracefully?

This does not always work under Windows (Networked APPDATA dirs)

The environment variable can be broken on systems. We came across a setup with the users directory on a network drive H:\ and APPDATA not resolving to anything.

I am surprised myself how anything works on this system, but I guess Windows's own API which one is supposed to use does work:
https://stackoverflow.com/questions/5920853/how-to-open-a-folder-in-appdata-with-c

This is the same used by QT: https://code.woboq.org/qt5/qtbase/src/corelib/io/qstandardpaths_win.cpp.html

I'd recommend using this API call get the directory.

Use XDG_CONFIG_HOME on MacOS

I don't have data on this but I am pretty sure that most people place scripts in unix style directories rather than /Library. As such, quite a few people probably use XDG_CONFIG_HOME even on MacOS. Yet this library doesn't support that, which means every CLI app relying on this library also doesn't (jesseduffield/lazygit#641)

Create Release

Just pulled this in and got the following output.

$ go get -u github.com/shibukawa/configdir
go: finding github.com/shibukawa/configdir latest
go: downloading github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0

Cutting a release for v1.0 or some minor variant would be nice to have.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.