Skip to content

Commit

Permalink
release-app fix use case where sideload fails on custom branch with s…
Browse files Browse the repository at this point in the history
…lashes
  • Loading branch information
louis030195 committed Feb 24, 2025
1 parent 281be1d commit 433d367
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.37.4"
version = "0.37.5"
description = ""
authors = ["you"]
license = ""
Expand Down
19 changes: 12 additions & 7 deletions screenpipe-core/src/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,13 +1132,18 @@ fn get_raw_github_url(url: &str) -> anyhow::Result<String> {
let parsed_url = Url::parse(url)?;
if parsed_url.host_str() == Some("github.com") {
let path_segments: Vec<&str> = parsed_url.path_segments().unwrap().collect();
if path_segments.len() >= 5 && path_segments[2] == "tree" {
let (owner, repo, _, branch) = (
path_segments[0],
path_segments[1],
path_segments[2],
path_segments[3],
);
if path_segments.len() >= 5 && path_segments.contains(&"tree") {
// Find the position of "tree" in the path
let tree_pos = path_segments.iter().position(|&s| s == "tree").unwrap();

let owner = path_segments[0];
let repo = path_segments[1];

// Everything after "tree" until the next major section is the branch
// Join with "/" to handle branches with slashes like "feature/branch-name"
let branch_end = path_segments.len();
let branch = path_segments[(tree_pos + 1)..branch_end].join("/");

let raw_url = format!(
"https://api.github.com/repos/{}/{}/git/trees/{}?recursive=1",
owner, repo, branch
Expand Down

0 comments on commit 433d367

Please sign in to comment.