diff options
| author | pml68 <contact@pml68.dev> | 2025-06-13 00:27:15 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-06-13 00:27:15 +0200 |
| commit | 0531f53a594f87faa7557d8a7cc049a807be6289 (patch) | |
| tree | c0ef5f915f4589d34263bd14fb3ff571d53332a1 /src/config.rs | |
| parent | chore: extract `iced_drop` into separate repo (`pml68/iced_drop`) (diff) | |
| download | iced-builder-0531f53a594f87faa7557d8a7cc049a807be6289.tar.gz | |
feat: create config file on startup if it doesn't exist
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 369a505..8db16bb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -67,6 +67,10 @@ impl Config { let path = Self::config_file_path(); if !path.try_exists()? { + let _ = fs::File::create(path) + .await + .expect("expected permissions to create config file"); + return Err(Error::ConfigMissing); } |
