File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ use tauri::State;
1616fn find_gh ( ) -> std:: path:: PathBuf {
1717 for candidate in & [
1818 "/opt/homebrew/bin/gh" , // Homebrew on Apple Silicon
19- "/usr/local/bin/gh" , // Homebrew on Intel / manual install
20- "/usr/bin/gh" , // System install
19+ "/usr/local/bin/gh" , // Homebrew on Intel / manual install
20+ "/usr/bin/gh" , // System install
2121 ] {
2222 if std:: path:: Path :: new ( candidate) . exists ( ) {
2323 return candidate. into ( ) ;
Original file line number Diff line number Diff line change @@ -558,7 +558,8 @@ pub fn apply_pulled_payload(
558558 }
559559 // Back up existing file before overwriting
560560 if path. exists ( ) {
561- let backup = path. with_extension ( "md.bak" ) ;
561+ let file_name = path. file_name ( ) . unwrap_or_default ( ) . to_string_lossy ( ) ;
562+ let backup = path. with_file_name ( format ! ( "{}.bak" , file_name) ) ;
562563 let _ = std:: fs:: copy ( & path, & backup) ;
563564 }
564565 std:: fs:: write ( & path, content) ?;
@@ -681,7 +682,12 @@ pub fn apply_pulled_payload(
681682 }
682683 // Back up existing file before overwriting
683684 if claude_md_path. exists ( ) {
684- let backup = claude_md_path. with_extension ( "md.bak" ) ;
685+ let file_name = claude_md_path
686+ . file_name ( )
687+ . unwrap_or_default ( )
688+ . to_string_lossy ( ) ;
689+ let backup =
690+ claude_md_path. with_file_name ( format ! ( "{}.bak" , file_name) ) ;
685691 let _ = std:: fs:: copy ( & claude_md_path, & backup) ;
686692 }
687693 if let Err ( e) = std:: fs:: write ( & claude_md_path, content) {
You can’t perform that action at this time.
0 commit comments