From 124d5c5adf67f0b68d2e41c7ddb07d9cb63f1996 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 25 Apr 2023 23:21:06 +0200 Subject: [PATCH] fix(cli): use snake_case fallback of app_name (#6788) fix regression introduced in https://github.com/tauri-apps/tauri/commit/2b22f649724816edf1f2745b33cbbea5507fb1cb --- .changes/cli-libname-dashes.md | 6 ++++++ tooling/cli/src/mobile/mod.rs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/cli-libname-dashes.md diff --git a/.changes/cli-libname-dashes.md b/.changes/cli-libname-dashes.md new file mode 100644 index 000000000..fbd5e7799 --- /dev/null +++ b/.changes/cli-libname-dashes.md @@ -0,0 +1,6 @@ +--- +'cli.rs': 'patch' +'cli.js': 'patch' +--- + +On mobile, fix regression introduced in `tauri-cli` version `2.0.0-alpha.3` where library not found error was thrown. diff --git a/tooling/cli/src/mobile/mod.rs b/tooling/cli/src/mobile/mod.rs index 4b0708b36..3765f8f34 100644 --- a/tooling/cli/src/mobile/mod.rs +++ b/tooling/cli/src/mobile/mod.rs @@ -12,6 +12,7 @@ use crate::{ interface::{AppInterface, AppSettings, DevProcess, Interface, Options as InterfaceOptions}, }; use anyhow::{bail, Result}; +use heck::ToSnekCase; use jsonrpsee::core::client::{Client, ClientBuilder, ClientT}; use jsonrpsee::server::{RpcModule, ServerBuilder, ServerHandle}; use jsonrpsee_client_transport::ws::WsTransportClientBuilder; @@ -281,7 +282,7 @@ fn get_app(config: &TauriConfig) -> App { let lib_name = interface .app_settings() .lib_name() - .unwrap_or(app_name.clone()); + .unwrap_or_else(|| app_name.to_snek_case()); let raw = RawAppConfig { name: app_name,