worktree_io/issue/
paths.rs1use std::path::PathBuf;
2
3use super::IssueRef;
4
5impl IssueRef {
6 #[must_use]
11 pub fn temp_path(&self) -> PathBuf {
12 self.bare_clone_path().join(self.workspace_dir_name())
13 }
14
15 #[must_use]
21 pub fn bare_clone_path(&self) -> PathBuf {
22 match self {
23 Self::GitHub { owner, repo, .. } | Self::Linear { owner, repo, .. } => dirs::home_dir()
24 .expect("could not determine home directory")
25 .join("worktrees")
26 .join("github")
27 .join(owner)
28 .join(repo),
29 Self::Local { project_path, .. } => {
30 let project_name = project_path
31 .file_name()
32 .unwrap_or_default()
33 .to_string_lossy();
34 dirs::home_dir()
35 .expect("could not determine home directory")
36 .join("worktrees")
37 .join("local")
38 .join(project_name.as_ref())
39 }
40 }
41 }
42}