Skip to content

Commit 2516203

Browse files
authored
windows build err fix (#3)
1 parent 841f458 commit 2516203

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

cli/src/upgrade.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use indicatif::{ProgressBar, ProgressStyle};
33
use serde::Deserialize;
44
use std::env;
55
use std::fs;
6+
7+
#[cfg(unix)]
68
use std::os::unix::fs::PermissionsExt;
79

810
const REPO: &str = "dcodesdev/clawd";
@@ -81,10 +83,7 @@ fn is_newer_version(current: &str, latest: &str) -> bool {
8183
let latest = version_to_comparable(latest);
8284

8385
// Simple semver comparison
84-
let current_parts: Vec<u32> = current
85-
.split('.')
86-
.filter_map(|s| s.parse().ok())
87-
.collect();
86+
let current_parts: Vec<u32> = current.split('.').filter_map(|s| s.parse().ok()).collect();
8887
let latest_parts: Vec<u32> = latest.split('.').filter_map(|s| s.parse().ok()).collect();
8988

9089
for i in 0..3 {
@@ -178,10 +177,7 @@ pub async fn execute_upgrade(force: bool) -> Result<()> {
178177
if let Err(e) = fs::rename(&current_exe, &backup_path) {
179178
// Try with elevated permissions hint
180179
fs::remove_file(&temp_path).ok();
181-
bail!(
182-
"Failed to replace binary (try with sudo): {}",
183-
e
184-
);
180+
bail!("Failed to replace binary (try with sudo): {}", e);
185181
}
186182
// Move new to current
187183
if let Err(e) = fs::rename(&temp_path, &current_exe) {

pr.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
# Creates a GitHub PR using the GitHub CLI
4+
5+
TITLE=$1
6+
7+
gh pr create --title "$TITLE" --body ""

0 commit comments

Comments
 (0)