Use a different worktree base directory for dev (#121)

This commit is contained in:
Solomon
2025-07-11 09:33:00 +01:00
committed by GitHub
parent 3640a61d08
commit 6c2d5cf616
2 changed files with 11 additions and 5 deletions

View File

@@ -268,15 +268,21 @@ impl TaskAttempt {
/// Get the base directory for vibe-kanban worktrees
pub fn get_worktree_base_dir() -> std::path::PathBuf {
let dir_name = if cfg!(debug_assertions) {
"vibe-kanban-dev"
} else {
"vibe-kanban"
};
if cfg!(target_os = "macos") {
// macOS already uses /var/folders/... which is persistent storage
std::env::temp_dir().join("vibe-kanban")
std::env::temp_dir().join(dir_name)
} else if cfg!(target_os = "linux") {
// Linux: use /var/tmp instead of /tmp to avoid RAM usage
std::path::PathBuf::from("/var/tmp/vibe-kanban")
std::path::PathBuf::from("/var/tmp").join(dir_name)
} else {
// Windows and other platforms: use temp dir with vibe-kanban subdirectory
std::env::temp_dir().join("vibe-kanban")
std::env::temp_dir().join(dir_name)
}
}