Skip to content

Commit 8c679dc

Browse files
committed
Check all directories ending with *-Challenge
1 parent 1287bf9 commit 8c679dc

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

.github/scripts/check.sh

+20-17
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,31 @@
77
#
88
cd "$(dirname ${BASH_SOURCE})"/../..
99

10-
challenge_dir="${PWD}/${1}"
1110
errors=0
1211

13-
echo "Checking ${challenge_dir}"
14-
echo
15-
16-
for question_path in $challenge_dir/*
12+
for challenge_dir in $PWD/*-Challenge
1713
do
18-
dirname="${question_path##*/}" # remove parent directoris
19-
question="${dirname#*-}" # remove leading day prefix
20-
echo "Question ${dirname}:"
14+
echo "Checking ${challenge_dir}"
15+
echo
2116

22-
for filepath in $question_path/*
17+
for question_path in $challenge_dir/*
2318
do
24-
filename="${filepath##*/}"
25-
if [[ "${filename%.*}" == "$question" || "$filename" == "README.md" ]]
26-
then
27-
echo " PASSED: ${filename}"
28-
else
29-
echo " FAILED: ${filename}"
30-
errors=$((errors + 1))
31-
fi
19+
dirname="${question_path##*/}" # remove parent directoris
20+
question="${dirname#*-}" # remove leading day prefix
21+
echo "Question ${dirname}:"
22+
23+
for filepath in $question_path/*
24+
do
25+
filename="${filepath##*/}"
26+
if [[ "${filename%.*}" == "$question" || "$filename" == "README.md" ]]
27+
then
28+
echo " PASSED: ${filename}"
29+
else
30+
echo " FAILED: ${filename}"
31+
errors=$((errors + 1))
32+
fi
33+
done
34+
echo
3235
done
3336
echo
3437
done

.github/workflows/main.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Check LeetCoding Challenge Apr 2020
14-
run: .github/scripts/check.sh 30-Day-Leetcoding-Challenge
15-
- name: Check LeetCoding Challenge May 2020
16-
run: .github/scripts/check.sh May-LeetCoding-Challenge
13+
- name: Check File Naming
14+
run: .github/scripts/check.sh

0 commit comments

Comments
 (0)