Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src-tauri/src/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,24 @@ pub fn get_discovery_paths() -> Vec<PathBuf> {
if let Ok(home_dir) = std::env::var("HOME") {
discovery_paths.push(PathBuf::from(home_dir).join("aw-modules"));
}
discovery_paths.push(PathBuf::from(
"/Applications/ActivityWatch.app/Contents/MacOS",
));
discovery_paths.push(PathBuf::from(
"/Applications/ActivityWatch.app/Contents/Resources",
));
// Detect if running inside a .app bundle dynamically via the executable path.
// This replaces the previous hardcoded /Applications/ActivityWatch.app paths,
// which broke for non-standard install locations (e.g. ~/Downloads, CI artifacts).
//
// Structure: Contents/MacOS/aw-tauri -> go up two levels -> Contents/Resources
if let Ok(exe_path) = std::env::current_exe() {
if let Some(contents_dir) = exe_path.parent().and_then(|p| p.parent()) {
let resources_dir = contents_dir.join("Resources");
if resources_dir.exists() {
// Running inside a macOS .app bundle.
// Modules bundled via tauri.conf.json `bundle.resources` land in Resources/modules/.
discovery_paths.push(resources_dir.join("modules"));
// Also include Resources/ directly for compatibility with modules placed
// at the root (e.g. legacy build_app_tauri.sh layout).
discovery_paths.push(resources_dir);
}
}
}
Comment thread
TimeToBuildBob marked this conversation as resolved.
}

#[cfg(target_os = "android")]
Expand Down
Loading