return proper code
This commit is contained in:
parent
d2b4d5456c
commit
022110ad0f
|
@ -98,7 +98,9 @@ checkurl() {
|
||||||
fi
|
fi
|
||||||
# Get the selected file path, without the preceding ./
|
# Get the selected file path, without the preceding ./
|
||||||
FILE=$(echo "$FILES" | head -n "$PICK" | tail -n 1 | sed 's/^\.\///')
|
FILE=$(echo "$FILES" | head -n "$PICK" | tail -n 1 | sed 's/^\.\///')
|
||||||
|
MD=0
|
||||||
if echo "$FILE" | grep ".md$" >/dev/null; then
|
if echo "$FILE" | grep ".md$" >/dev/null; then
|
||||||
|
MD=1
|
||||||
FILE=$(basename "$FILE" .md)
|
FILE=$(basename "$FILE" .md)
|
||||||
fi
|
fi
|
||||||
# Replace the old link with the new one.
|
# Replace the old link with the new one.
|
||||||
|
@ -109,7 +111,11 @@ checkurl() {
|
||||||
sed -i "s/$REPLACE/\($REPLACEWITH\)/" "$1"
|
sed -i "s/$REPLACE/\($REPLACEWITH\)/" "$1"
|
||||||
# print the URL for use in checkhash
|
# print the URL for use in checkhash
|
||||||
echo "$LINK"
|
echo "$LINK"
|
||||||
|
if [ "$MD" -eq 1 ]; then
|
||||||
return 0
|
return 0
|
||||||
|
else
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
) 200>brokenlinks.lock
|
) 200>brokenlinks.lock
|
||||||
|
|
Loading…
Reference in New Issue