mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
refactor: move deleted tauri APIs, prepare for next release (#355)
This commit is contained in:
committed by
GitHub
parent
937e6a5be6
commit
702b7b36bd
@@ -11,12 +11,11 @@ use config::{Arg, Config};
|
||||
pub use error::Error;
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
// TODO: use PluginApi#app when 2.0.0-alpha.9 is released
|
||||
pub struct Cli<R: Runtime>(PluginApi<R, Config>, AppHandle<R>);
|
||||
pub struct Cli<R: Runtime>(PluginApi<R, Config>);
|
||||
|
||||
impl<R: Runtime> Cli<R> {
|
||||
pub fn matches(&self) -> Result<parser::Matches> {
|
||||
parser::get_matches(self.0.config(), self.1.package_info())
|
||||
parser::get_matches(self.0.config(), self.0.app().package_info())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +38,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R, Config> {
|
||||
Builder::new("cli")
|
||||
.invoke_handler(tauri::generate_handler![cli_matches])
|
||||
.setup(|app, api| {
|
||||
app.manage(Cli(api, app.clone()));
|
||||
app.manage(Cli(api));
|
||||
Ok(())
|
||||
})
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user