Skip to content

Commit

Permalink
Fixed Scripts of both github & gitlab README file checker
Browse files Browse the repository at this point in the history
  • Loading branch information
SlyPex committed Aug 5, 2024
1 parent 7b21aa0 commit cd71fce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .github/scripts/readme_file_checker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

set -euo pipefail

SUCCESS="true"

if [[ "$#" -gt 2 ]]
Expand All @@ -17,7 +15,7 @@ else

for dir_chall in ${CHALLS_UNDER_DIR[@]}
do
CHALL_LINE=$(grep -P "(?<=(\||\[))${dir_chall}(?=(\||\]))" $2)
CHALL_LINE=$(grep -P "(?<=(\||\[))$dir_chall(?=(\||\]))" $2 | cut -d '|' -f 2)
if [[ -n $CHALL_LINE ]]
then
echo "[*] - SUCCESS : $dir_chall is Found in $2 file"
Expand Down Expand Up @@ -45,5 +43,6 @@ else
elif [[ $SUCCESS = "False" ]]
then
echo "[!] - ERROR : Checking Failed, Missing Challegnes in $2 File"
exit 1
fi
fi
5 changes: 2 additions & 3 deletions .gitlab/scripts/readme_file_checker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

set -euo pipefail

SUCCESS="true"

if [[ "$#" -gt 2 ]]
Expand All @@ -17,7 +15,7 @@ else

for dir_chall in ${CHALLS_UNDER_DIR[@]}
do
CHALL_LINE=$(grep -P "(?<=(\||\[))${dir_chall}(?=(\||\]))" $2)
CHALL_LINE=$(grep -P "(?<=(\||\[))$dir_chall(?=(\||\]))" $2 | cut -d '|' -f 2)
if [[ -n $CHALL_LINE ]]
then
echo "[*] - SUCCESS : $dir_chall is Found in $2 file"
Expand Down Expand Up @@ -45,5 +43,6 @@ else
elif [[ $SUCCESS = "False" ]]
then
echo "[!] - ERROR : Checking Failed, Missing Challegnes in $2 File"
exit 1
fi
fi

0 comments on commit cd71fce

Please sign in to comment.