Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src-tauri/src/commands/cloud_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use tauri::State;
fn find_gh() -> std::path::PathBuf {
for candidate in &[
"/opt/homebrew/bin/gh", // Homebrew on Apple Silicon
"/usr/local/bin/gh", // Homebrew on Intel / manual install
"/usr/bin/gh", // System install
"/usr/local/bin/gh", // Homebrew on Intel / manual install
"/usr/bin/gh", // System install
] {
if std::path::Path::new(candidate).exists() {
return candidate.into();
Expand Down
10 changes: 8 additions & 2 deletions src-tauri/src/services/gist_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ pub fn apply_pulled_payload(
}
// Back up existing file before overwriting
if path.exists() {
let backup = path.with_extension("md.bak");
let file_name = path.file_name().unwrap_or_default().to_string_lossy();
let backup = path.with_file_name(format!("{}.bak", file_name));
let _ = std::fs::copy(&path, &backup);
}
std::fs::write(&path, content)?;
Expand Down Expand Up @@ -681,7 +682,12 @@ pub fn apply_pulled_payload(
}
// Back up existing file before overwriting
if claude_md_path.exists() {
let backup = claude_md_path.with_extension("md.bak");
let file_name = claude_md_path
.file_name()
.unwrap_or_default()
.to_string_lossy();
let backup =
claude_md_path.with_file_name(format!("{}.bak", file_name));
let _ = std::fs::copy(&claude_md_path, &backup);
}
if let Err(e) = std::fs::write(&claude_md_path, content) {
Expand Down
Loading