From 5f3a1226b7093e1d4c7d04eb719803d52e932a05 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 2 Feb 2026 09:32:17 -0700 Subject: [PATCH] fix(import): handle absolute file paths in ralph-import Previously, ralph-import would prepend '../' to the source file path after cd'ing into the project directory. This breaks when an absolute path is provided (e.g., /Users/foo/file.md becomes ..//Users/foo/file.md). Now checks if the path is absolute (starts with /) before prepending '../'. Credit: @GiladSchneider (PR #92) --- ralph_import.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ralph_import.sh b/ralph_import.sh index 13a2f4b..91de224 100755 --- a/ralph_import.sh +++ b/ralph_import.sh @@ -600,7 +600,11 @@ main() { # Copy source file to project (uses basename since we cd'd into project) local source_basename source_basename=$(basename "$source_file") - cp "../$source_file" "$source_basename" + if [[ "$source_file" == /* ]]; then + cp "$source_file" "$source_basename" + else + cp "../$source_file" "$source_basename" + fi # Run conversion using local copy (basename, not original path) convert_prd "$source_basename" "$project_name"