We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
create
1 parent be5aebd commit ea8eadcCopy full SHA for ea8eadc
2 files changed
.changes/fix-fs-write-default-option.md
@@ -0,0 +1,6 @@
1
+---
2
+"fs": "patch"
3
+"fs-js": "patch"
4
5
+
6
+Fix incorrect `create` option default value for `writeFile` and `writeTextFile` which didn't match documentation.
plugins/fs/src/commands.rs
@@ -585,14 +585,18 @@ pub struct WriteFileOptions {
585
base: BaseOptions,
586
#[serde(default)]
587
append: bool,
588
- #[serde(default)]
+ #[serde(default = "default_create_value")]
589
create: bool,
590
591
create_new: bool,
592
#[allow(unused)]
593
mode: Option<u32>,
594
}
595
596
+fn default_create_value() -> bool {
597
+ true
598
+}
599
600
fn write_file_inner<R: Runtime>(
601
app: AppHandle<R>,
602
path: SafePathBuf,
0 commit comments