File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,24 @@ fn find_claude_binary(app_handle: &AppHandle) -> Result<String, String> {
137
137
138
138
/// Gets the path to the ~/.claude directory
139
139
fn get_claude_dir ( ) -> Result < PathBuf > {
140
- dirs:: home_dir ( )
140
+ let claude_path = dirs:: home_dir ( )
141
141
. context ( "Could not find home directory" ) ?
142
- . join ( ".claude" )
143
- . canonicalize ( )
144
- . context ( "Could not find ~/.claude directory" )
142
+ . join ( ".claude" ) ;
143
+
144
+ // First check if the directory exists
145
+ if !claude_path. exists ( ) {
146
+ return Err ( anyhow:: anyhow!( "~/.claude directory does not exist" ) ) ;
147
+ }
148
+
149
+ // Try to canonicalize, but fall back to the original path if it fails
150
+ match claude_path. canonicalize ( ) {
151
+ Ok ( canonical_path) => Ok ( canonical_path) ,
152
+ Err ( _) => {
153
+ // If canonicalize fails but the directory exists, use the original path
154
+ log:: warn!( "Could not canonicalize ~/.claude path, using original path" ) ;
155
+ Ok ( claude_path)
156
+ }
157
+ }
145
158
}
146
159
147
160
/// Gets the actual project path by reading the cwd from the first JSONL entry
You can’t perform that action at this time.
0 commit comments