Skip to content

Commit e4aa35e

Browse files
committed
fix(cli): init tests
1 parent 9c16eef commit e4aa35e

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

crates/tauri-cli/src/init.rs

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,34 @@ pub fn command(mut options: Options) -> Result<()> {
195195
template_target_path
196196
);
197197
} else {
198-
let (tauri_dep, tauri_build_dep) = if let Some(tauri_path) = &options.tauri_path {
199-
(
200-
format!(
201-
r#"{{ path = {:?} }}"#,
202-
resolve_tauri_path(tauri_path, "crates/tauri")
203-
),
204-
format!(
205-
"{{ path = {:?} }}",
206-
resolve_tauri_path(tauri_path, "crates/tauri-build")
207-
),
208-
)
209-
} else {
210-
(
211-
format!(r#"{{ version = "{}" }}"#, metadata.tauri),
212-
format!(r#"{{ version = "{}" }}"#, metadata.tauri_build),
213-
)
214-
};
198+
let (tauri_dep, tauri_build_dep, tauri_utils_dep, tauri_plugin_dep) =
199+
if let Some(tauri_path) = &options.tauri_path {
200+
(
201+
format!(
202+
r#"{{ path = {:?} }}"#,
203+
resolve_tauri_path(tauri_path, "crates/tauri")
204+
),
205+
format!(
206+
"{{ path = {:?} }}",
207+
resolve_tauri_path(tauri_path, "crates/tauri-build")
208+
),
209+
format!(
210+
"{{ path = {:?} }}",
211+
resolve_tauri_path(tauri_path, "crates/tauri-utils")
212+
),
213+
format!(
214+
"{{ path = {:?} }}",
215+
resolve_tauri_path(tauri_path, "crates/tauri-plugin")
216+
),
217+
)
218+
} else {
219+
(
220+
format!(r#"{{ version = "{}" }}"#, metadata.tauri),
221+
format!(r#"{{ version = "{}" }}"#, metadata.tauri_build),
222+
r#"{{ version = "2" }}"#.to_string(),
223+
r#"{{ version = "2" }}"#.to_string(),
224+
)
225+
};
215226

216227
let _ = remove_dir_all(&template_target_path);
217228
let mut handlebars = Handlebars::new();
@@ -223,6 +234,8 @@ pub fn command(mut options: Options) -> Result<()> {
223234
data.insert("patch_tauri_dep", to_json(true));
224235
}
225236
data.insert("tauri_build_dep", to_json(tauri_build_dep));
237+
data.insert("tauri_utils_dep", to_json(tauri_utils_dep));
238+
data.insert("tauri_plugin_dep", to_json(tauri_plugin_dep));
226239
data.insert(
227240
"frontend_dist",
228241
to_json(options.frontend_dist.as_deref().unwrap_or("../dist")),

crates/tauri-cli/templates/app/src-tauri/Cargo.crate-manifest

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ serde_json = "1.0"
2222
serde = { version = "1.0", features = ["derive"] }
2323
log = "0.4"
2424
tauri = {{ tauri_dep }}
25-
tauri-plugin-log = "2.0.0-rc"
25+
tauri-plugin-log = "2"
2626
{{#if patch_tauri_dep}}
2727
[patch.crates-io]
2828
tauri = {{ tauri_dep }}
29+
tauri-utils = {{ tauri_utils_dep }}
30+
tauri-plugin = {{ tauri_plugin_dep }}
2931
{{/if}}

0 commit comments

Comments
 (0)