mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-03 00:21:34 +03:00
parent
855effadd9
commit
e34ee4c29c
5
.changes/workspace-detection.md
Normal file
5
.changes/workspace-detection.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": minor
|
||||
---
|
||||
|
||||
Fixes the bundler workspace detection.
|
@ -507,19 +507,18 @@ impl Settings {
|
||||
/// Otherwise returns the current directory.
|
||||
pub fn get_workspace_dir(current_dir: &PathBuf) -> PathBuf {
|
||||
let mut dir = current_dir.clone();
|
||||
let project_name = CargoSettings::load(&dir).unwrap().package.unwrap().name;
|
||||
let project_path = current_dir.clone();
|
||||
|
||||
while dir.pop() {
|
||||
if let Ok(cargo_settings) = CargoSettings::load(&dir) {
|
||||
if let Some(workspace_settings) = cargo_settings.workspace {
|
||||
if workspace_settings.members.is_some()
|
||||
&& workspace_settings
|
||||
.members
|
||||
.expect("Couldn't get members")
|
||||
if let Some(members) = workspace_settings.members {
|
||||
if members
|
||||
.iter()
|
||||
.any(|member| member.as_str() == project_name)
|
||||
{
|
||||
return dir;
|
||||
.any(|member| dir.join(member) == project_path)
|
||||
{
|
||||
return dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user