Explorar el Código

fix(cli.rs): enable the `updater` feature on cli (#1597)

Lucas Fernandes Nogueira hace 4 años
padre
commit
9490b257d2

+ 5 - 0
.changes/updater-feature.md

@@ -0,0 +1,5 @@
+---
+"cli.rs": patch
+---
+
+Enable `tauri` `updater` feature when `tauri.conf.json > tauri > updater > active` is set to `true`.

+ 1 - 1
examples/api/src-tauri/Cargo.toml

@@ -11,7 +11,7 @@ tauri-build = { path = "../../../core/tauri-build" }
 [dependencies]
 serde_json = "1.0"
 serde = { version = "1.0", features = [ "derive" ] }
-tauri = { path = "../../../core/tauri", features =["api-all", "cli"]}
+tauri = { path = "../../../core/tauri", features =["api-all", "cli", "updater"]}
 
 [features]
 default = [ "custom-protocol" ]

+ 1 - 1
examples/updater/src-tauri/Cargo.toml

@@ -11,7 +11,7 @@ tauri-build = { path = "../../../core/tauri-build", features = [ "codegen" ]}
 [dependencies]
 serde_json = "1.0"
 serde = { version = "1.0", features = [ "derive" ] }
-tauri = { path = "../../../core/tauri", features =["api-all"]}
+tauri = { path = "../../../core/tauri", features =["api-all", "updater"]}
 
 [features]
 default = [ "custom-protocol" ]

+ 3 - 0
tooling/cli.rs/src/helpers/manifest.rs

@@ -38,6 +38,9 @@ pub fn rewrite_manifest(config: ConfigHandle) -> crate::Result<()> {
     if config.tauri.cli.is_some() {
       features.push("cli").unwrap();
     }
+    if config.tauri.updater.active {
+      features.push("updater").unwrap();
+    }
 
     match tauri {
       Value::InlineTable(tauri_def) => {