mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-01 03:02:28 +03:00
fix(core): path commands not added (#7171)
This commit is contained in:
parent
6d3f3138b9
commit
8124145d6c
5
.changes/enable-path-commands.md
Normal file
5
.changes/enable-path-commands.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes path commands not being added.
|
@ -13,7 +13,6 @@ use serde::{de::Error as DeError, Deserialize, Deserializer};
|
|||||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||||
use serialize_to_javascript::{default_template, DefaultTemplate, Template};
|
use serialize_to_javascript::{default_template, DefaultTemplate, Template};
|
||||||
|
|
||||||
#[cfg(any(path_all, test))]
|
|
||||||
mod commands;
|
mod commands;
|
||||||
mod error;
|
mod error;
|
||||||
pub use error::*;
|
pub use error::*;
|
||||||
@ -341,23 +340,6 @@ struct InitJavascript {
|
|||||||
|
|
||||||
/// Initializes the plugin.
|
/// Initializes the plugin.
|
||||||
pub(crate) fn init<R: Runtime>() -> TauriPlugin<R> {
|
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)]
|
#[cfg(windows)]
|
||||||
let (sep, delimiter) = ("\\", ";");
|
let (sep, delimiter) = ("\\", ";");
|
||||||
#[cfg(not(windows))]
|
#[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
|
// this will never fail with the above sep and delimiter values
|
||||||
.unwrap();
|
.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())
|
.js_init_script(init_js.to_string())
|
||||||
.setup(|app, _api| {
|
.setup(|app, _api| {
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
|
16
examples/api/src-tauri/Cargo.lock
generated
16
examples/api/src-tauri/Cargo.lock
generated
@ -2226,9 +2226,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.59"
|
version = "1.0.60"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
|
checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@ -2528,18 +2528,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.163"
|
version = "1.0.164"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
|
checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.163"
|
version = "1.0.164"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
|
checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -3187,9 +3187,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.21"
|
version = "0.3.22"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
|
checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa 1.0.6",
|
"itoa 1.0.6",
|
||||||
"libc",
|
"libc",
|
||||||
|
Loading…
Reference in New Issue
Block a user