Skip to content

Searched config location doesn't match the documentation #329

@celynw

Description

@celynw

Describe the bug

The locations which are searched for config files don't match the documentation.
I printed what was actually being searched and I found:

  • $HOME/.config/daktilo.toml
  • $HOME/.config/daktilo_lib/daktilo.toml
  • $HOME/.config/daktilo_lib/config

Note daktilo_lib as opposed to daktilo.

Related code location:

vec![
config_dir.join(DEFAULT_CONFIG),
config_dir.join(env!("CARGO_PKG_NAME")).join(DEFAULT_CONFIG),
config_dir.join(env!("CARGO_PKG_NAME")).join("config"),
]

Seems CARGO_PKG_NAME is evaluated as daktilo_lib. I think it's just a scoping/namespace issue. I don't know any rust though.

To reproduce

For instance, create a config file under $HOME/.config/daktilo/daktilo.toml and watch it not taking effect.

Expected behavior

I believe config files should be searched at the locations specified in the documentation.

Screenshots / Logs

Console lines when I've created a config file at $HOME/.config/datkilo/daktilo.toml:

INFO daktilo: Starting...
WARN daktilo: Using the default configuration (run with `--init` to save it to a file).
WARN daktilo: No preset specified, using the default preset.

Console lines when I've created a config file at $HOME/.config/datkilo_lib/daktilo.toml:

INFO daktilo: Starting...
WARN daktilo: No preset specified, using the default preset.

Software information

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions