Skip to content

Commit 0d17600

Browse files
Parse custom user config only when the file exsits (#142)
1 parent 249e4fc commit 0d17600

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ fn Root(cx: Scope) -> Element {
7979

8080
> WARNING: `dip` is still in the very early stages of development.
8181
82-
> `main` branch is currently preparing for `v0.2` release.
83-
8482
> `v0.1` is totally a different application. I wanted to make a cross-platform text editor but ended up making this framework.
8583
8684
## Features

plugins/bundle/src/config.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ impl Plugin for BundleConfigPlugin {
2727
fn add_sources(mut builder: ResMut<ConfigBuilder<DefaultState>>) {
2828
let config_file_path = BundleConfig::config_file_path();
2929

30-
*builder = builder
31-
.clone()
32-
.add_source(File::with_name(&config_file_path.display().to_string()));
30+
if config_file_path.is_file() {
31+
*builder = builder
32+
.clone()
33+
.add_source(File::with_name(&config_file_path.display().to_string()));
34+
}
3335
}
3436

3537
/// General dip configuration
@@ -137,7 +139,10 @@ impl ConfigParser {
137139
if path.is_dir() {
138140
Ok(path)
139141
} else {
140-
Err(de::Error::custom("Bundle path is not a directory"))
142+
Err(de::Error::custom(&format!(
143+
"Make sure to create bundle directory: {}",
144+
path.display()
145+
)))
141146
}
142147
}
143148
Err(_e) => Err(de::Error::custom("Failed to parse bundle directory path")),

0 commit comments

Comments
 (0)