You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice work! I was thinking about writing a snippets manager some time before then I saw this project.
But there are something to improve in configuration. People would include their dotfiles in sync, so a absolute path (like db_dir = '/home/username/.local/share/the_way_db') would not be a good idea, since the username would change in different devices.
At first, I think the path should just start from user home, for example: db_dir = '.local/share/the_way_db', but this would break the backforward compatibility. So I suggest accepting relative path (such as ~) or environment variable (such as $HOME, $XDG_DATA_HOME) in the configuration file.
Take another project for example, gopass is a password manager, which also encounter this issue, see also: issue and pull request.
Another advice is layered configuration. I have seen the default configuration implementation in the code, but if you delete some line in ~/.config/the-way/default-config.toml, such as db_dir, the-way would panic with error like can't parse config file.
That is not good behavior. I think the-way should accpect part of the whole configuration and use the default one if it's not provided. See also The Twelve-Factor App.
The text was updated successfully, but these errors were encountered:
Nice work! I was thinking about writing a snippets manager some time before then I saw this project.
But there are something to improve in configuration. People would include their dotfiles in sync, so a absolute path (like db_dir = '/home/username/.local/share/the_way_db') would not be a good idea, since the username would change in different devices.
At first, I think the path should just start from user home, for example: db_dir = '.local/share/the_way_db', but this would break the backforward compatibility. So I suggest accepting relative path (such as
~
) or environment variable (such as$HOME
,$XDG_DATA_HOME
) in the configuration file.Take another project for example, gopass is a password manager, which also encounter this issue, see also: issue and pull request.
Another advice is layered configuration. I have seen the default configuration implementation in the code, but if you delete some line in
~/.config/the-way/default-config.toml
, such asdb_dir
, the-way would panic with error like can't parse config file.That is not good behavior. I think the-way should accpect part of the whole configuration and use the default one if it's not provided. See also The Twelve-Factor App.
The text was updated successfully, but these errors were encountered: