Skip to content

Commit e17ce87

Browse files
committedFeb 27, 2025·
release-app fix windows screenpipe install path
1 parent 4634027 commit e17ce87

File tree

6 files changed

+60
-3
lines changed

6 files changed

+60
-3
lines changed
 

‎.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
cp screenpipe-vision/tests/testing_OCR.png target/debug/deps/
113113
114114
- name: Run specific Windows OCR cargo test
115-
run: cargo test test_process_ocr_task_windows
115+
run: cargo test test_process_ocr_task_windows pipes_test
116116

117117
test-macos:
118118
runs-on: macos-latest

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exclude = ["screenpipe-app-tauri/src-tauri"]
1111
resolver = "2"
1212

1313
[workspace.package]
14-
version = "0.2.60"
14+
version = "0.2.61"
1515
authors = ["louis030195 <hi@louis030195.com>"]
1616
description = ""
1717
repository = "https://github.com/mediar-ai/screenpipe"

‎pipes/rewind/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "rewind",
3+
<<<<<<< Updated upstream
34
"version": "0.1.13",
5+
=======
6+
"version": "0.1.14",
7+
>>>>>>> Stashed changes
48
"private": true,
59
"scripts": {
610
"dev": "next dev --turbopack",

‎screenpipe-app-tauri/src-tauri/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "screenpipe-app"
3-
version = "0.38.8"
3+
version = "0.38.9"
44
description = ""
55
authors = ["you"]
66
license = ""

‎screenpipe-core/src/pipes.rs

+8
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,14 @@ pub async fn download_pipe(source: &str, screenpipe_dir: PathBuf) -> anyhow::Res
818818
debug!("Source is a URL: {}", parsed_url);
819819
if parsed_url.host_str() == Some("github.com") {
820820
download_github_folder(&parsed_url, &temp_dir).await
821+
} else if cfg!(windows) && parsed_url.scheme().len() == 1 {
822+
// This is likely a Windows path with drive letter being interpreted as URL scheme
823+
debug!("Detected Windows path with drive letter, treating as local path");
824+
let source_path = Path::new(source);
825+
if !source_path.exists() || !source_path.is_dir() {
826+
anyhow::bail!("Invalid local source path");
827+
}
828+
copy_dir_all(source_path, &temp_dir).await
821829
} else {
822830
anyhow::bail!("Unsupported URL format");
823831
}

‎screenpipe-core/tests/pipes_test.rs

+45
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,49 @@ mod tests {
238238
time_diff
239239
);
240240
}
241+
242+
#[tokio::test]
243+
#[cfg(windows)]
244+
async fn test_download_pipe_windows_path() {
245+
init();
246+
let temp_dir = TempDir::new().unwrap();
247+
let screenpipe_dir = temp_dir.path().to_path_buf();
248+
249+
// Create a source directory with a simple pipe
250+
let source_dir = temp_dir.path().join("source_pipe");
251+
tokio::fs::create_dir_all(&source_dir).await.unwrap();
252+
253+
// Create a basic pipe.js file
254+
tokio::fs::write(
255+
source_dir.join("pipe.js"),
256+
r#"console.log("Hello from Windows pipe test!");"#,
257+
)
258+
.await
259+
.unwrap();
260+
261+
// Get the absolute Windows path with backslashes
262+
let source_path = source_dir.to_str().unwrap().replace("/", "\\");
263+
println!("Testing Windows path: {}", source_path);
264+
265+
// Try to download the pipe using the Windows path
266+
let result = download_pipe(&source_path, screenpipe_dir.clone()).await;
267+
268+
// The function should succeed with a Windows path
269+
assert!(
270+
result.is_ok(),
271+
"Failed to handle Windows path: {:?}",
272+
result.err()
273+
);
274+
275+
// Verify the pipe was copied correctly
276+
let pipe_name = source_dir.file_name().unwrap().to_str().unwrap();
277+
let dest_path = screenpipe_dir
278+
.join("pipes")
279+
.join(format!("{}_local", pipe_name));
280+
assert!(dest_path.exists(), "Destination pipe directory not found");
281+
assert!(
282+
dest_path.join("pipe.js").exists(),
283+
"pipe.js not found in destination"
284+
);
285+
}
241286
}

0 commit comments

Comments
 (0)