Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: config file as toml in .config/chess-tui/ #71

Merged
merged 5 commits into from
May 12, 2024

Conversation

damien-mathieu1
Copy link
Contributor

@damien-mathieu1 damien-mathieu1 commented May 4, 2024

Wrong path for chess-tui config file

Description

Create the config file in ~/.config/chess-tui/config.toml

Creates two parameter in the toml config

  • display_mode = ASCII or DEFAULT
  • engine_path = <path_to_engine>

Fixes #70

Too simple config file and "wrong" location

How Has This Been Tested?

I created a simple test that creates the folder and test the values

  • Test test_config_create

Copy link
Owner

@thomas-mauran thomas-mauran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice overall ! just some unwrap that could be removed and this code that could be used in multiple places and mutualized in constant

        let home_dir = match dirs::home_dir() {
            Some(dir) => dir,
            None => {
                eprintln!("Impossible to get your home directory");
                return ();
            }
        };
        

src/board.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/app.rs Outdated Show resolved Hide resolved
Copy link
Owner

@thomas-mauran thomas-mauran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/constants.rs Outdated Show resolved Hide resolved
@thomas-mauran thomas-mauran changed the title Wrong path for chess-tui config file feat: config file as toml in .config/chess-tui/ May 12, 2024
@thomas-mauran thomas-mauran merged commit b0d8995 into thomas-mauran:main May 12, 2024
3 checks passed
@JeromeSchmied JeromeSchmied mentioned this pull request Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong path for chess-tui config file
2 participants