fix(core): path commands not added (#7171)

This commit is contained in:
Lucas Fernandes Nogueira 2023-06-08 17:08:46 -07:00 committed by GitHub
parent 6d3f3138b9
commit 8124145d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 27 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Fixes path commands not being added.

View File

@ -13,7 +13,6 @@ use serde::{de::Error as DeError, Deserialize, Deserializer};
use serde_repr::{Deserialize_repr, Serialize_repr};
use serialize_to_javascript::{default_template, DefaultTemplate, Template};
#[cfg(any(path_all, test))]
mod commands;
mod error;
pub use error::*;
@ -341,23 +340,6 @@ struct InitJavascript {
/// Initializes the plugin.
pub(crate) fn init<R: Runtime>() -> TauriPlugin<R> {
#[allow(unused_mut)]
let mut builder = Builder::new("path");
#[cfg(any(path_all, test))]
{
builder = builder.invoke_handler(crate::generate_handler![
commands::resolve_directory,
commands::resolve,
commands::normalize,
commands::join,
commands::dirname,
commands::extname,
commands::basename,
commands::is_absolute
]);
}
#[cfg(windows)]
let (sep, delimiter) = ("\\", ";");
#[cfg(not(windows))]
@ -368,7 +350,17 @@ pub(crate) fn init<R: Runtime>() -> TauriPlugin<R> {
// this will never fail with the above sep and delimiter values
.unwrap();
builder
Builder::new("path")
.invoke_handler(crate::generate_handler![
commands::resolve_directory,
commands::resolve,
commands::normalize,
commands::join,
commands::dirname,
commands::extname,
commands::basename,
commands::is_absolute
])
.js_init_script(init_js.to_string())
.setup(|app, _api| {
#[cfg(target_os = "android")]

View File

@ -2226,9 +2226,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]]
name = "proc-macro2"
version = "1.0.59"
version = "1.0.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
dependencies = [
"unicode-ident",
]
@ -2528,18 +2528,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.163"
version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.163"
version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
dependencies = [
"proc-macro2",
"quote",
@ -3187,9 +3187,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.21"
version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
dependencies = [
"itoa 1.0.6",
"libc",