mirror of
https://github.com/kagisearch/smallweb.git
synced 2025-12-22 10:57:09 +00:00
fix: Fix sed -i for BSD/macOS compatibility
Co-authored-by: aider (gemini/gemini-2.5-pro-preview-06-05) <aider@aider.chat>
This commit is contained in:
@@ -74,7 +74,7 @@ while IFS=" " read -r url host exitcode url_effective response_code; do
|
||||
# If the old and new URL only differ in these minor details, replace the
|
||||
# original url with the new one.
|
||||
if [[ "$OLD_URL" == "$NEW_URL" ]]; then
|
||||
sed -i "s>^${url}\$>${url_effective}>g" "$SMALLWEB"
|
||||
sed -i '' "s>^${url}\$>${url_effective}>g" "$SMALLWEB"
|
||||
else
|
||||
echo -e "${url}\t${host}\t${exitcode}\t${url_effective}\t${response_code}" >> "$TMP"
|
||||
fi
|
||||
@@ -132,7 +132,7 @@ while IFS=" " read -r url host exitcode url_effective response_code; do
|
||||
if [[ $found == true ]] ; then
|
||||
echo -e "${url}\t${host}\t${exitcode}\t${url_effective}\t${response_code}" >> "$TMP"
|
||||
else
|
||||
sed -i "\ ^${url}\$ d" "$SMALLWEB"
|
||||
sed -i '' "\ ^${url}\$ d" "$SMALLWEB"
|
||||
fi
|
||||
done <<< "$(tail --lines=+2 "$URLS_CHANGED")"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user