Skip to content

Commit 122020f

Browse files
committed
Update URL check
* Make sure the real_time doc string is picked up by the URL check * Do not check already checked links in url_check This should greatly speed up things
1 parent 518c676 commit 122020f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/helpers/check_urls.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ urls=$(grep -oP '(http|ftp|https):\/\/([a-zA-Z0-9_-]+(?:(?:\.[a-zA-Z0-9_-]+)+))(
3838
fail_counter=0
3939

4040
FAILED_LINKS=()
41+
CHECKED_LINKS=()
4142
for item in $urls; do
4243
# echo $item
4344
skip=0
@@ -53,15 +54,18 @@ for item in $urls; do
5354
filename=$(echo "$item" | cut -d':' -f1)
5455
url=$(echo "$item" | cut -d':' -f2-)
5556
echo -n "Checking $url from file $filename"
56-
if ! curl --head --silent --fail "$url" 2>&1 > /dev/null; then
57-
echo -e " \033[0;31mNOT FOUND\033[32m\n"
57+
if [[ $(echo ${CHECKED_LINKS[@]} | fgrep -w $url) ]]; then
58+
echo -e " \033[36malready checked\033[0m"
59+
elif ! curl --head --silent --fail "$url" 2>&1 > /dev/null; then
60+
echo -e " \033[0;31mNOT FOUND\033[0m"
5861
FAILED_LINKS+=("$url from file $filename")
5962
((fail_counter=fail_counter+1))
6063
else
61-
printf " \033[32mok\033[0m\n"
64+
echo -e " \033[32mok\033[0m"
6265
fi
66+
CHECKED_LINKS+=("$url")
6367
done
6468

6569
echo "Failed files:"
6670
printf '%s\n' "${FAILED_LINKS[@]}"
67-
exit $fail_counter
71+
exit $fail_counter

src/helpers.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
#include <fstream>
3434
#include <iostream>
3535

36-
const std::string RT_DOC_URL = "https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/"
37-
"ur_client_library/doc/real_time.html";
36+
// clang-format off
37+
// We want to keep the URL in one line to avoid formatting issues. This will make it easier to
38+
// extract the URL for an automatic check.
39+
const std::string RT_DOC_URL = "https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_client_library/doc/real_time.html";
40+
// clang-format on
3841

3942
namespace urcl
4043
{

0 commit comments

Comments
 (0)