We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76d275b commit 1702bf0Copy full SHA for 1702bf0
brev/test-links.bash
100644
100755
@@ -55,9 +55,10 @@ TARGET_ABS="$(cd "$TARGET_PATH" && pwd)" 2>/dev/null || {
55
}
56
57
# Get relative path from repo root
58
-RELATIVE_TARGET="${TARGET_ABS#$REPO_ROOT/}"
59
-if [ "$RELATIVE_TARGET" = "$TARGET_ABS" ]; then
60
- # Path is not under repo root
+RELATIVE_TARGET="$(realpath --relative-to="$REPO_ROOT" "$TARGET_ABS")"
+
+# Check if path is outside repo (would start with ../)
61
+if [[ "$RELATIVE_TARGET" == ../* ]]; then
62
echo -e "${RED}Error: Path '$TARGET_PATH' is not within the current repository${NC}"
63
exit 1
64
fi
0 commit comments