Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ if [ ! -d "$COPY_DEST" ]; then
exit 84
fi

# In build directory
cd "$COPY_DEST"

# Copy from delivery directory to build directory
if [ "$DELIVERY_DIR" != "$COPY_DEST" ]; then
cp -a "$DELIVERY_DIR"/. .
fi

# Back to root directory
cd - >/dev/null

find "$COPY_DEST" \
Expand All @@ -49,14 +52,28 @@ find "$COPY_DEST" \
-o \( -name '*.c' -o -name '*.h' \) -print0 \
> "$COPY_DEST/coding-style-files.log"

# Back to build directory
cd - >/dev/null

# If the student has compile flags, ignore them
rm -f compile_commands.json
rm -f compile_flags.txt

if [ -d rush-1-1 ]; then
# Rush1 is a special case
bear -- gcc rush-1-*/*.c >/dev/null 2>&1
else
elif [[ -f Makefile || -f makefile || -f GNUmakefile ]]; then
# Normal case, with a Makefile at the root
bear -- make re >/dev/null 2>&1
else
# Most days of the CPool
if [ -d lib/my ]; then
(cd lib/my && bear -- ./build.sh) >/dev/null 2>&1
fi
bear -- gcc *.c -I./include >/dev/null 2>&1
fi

# Back to root directory
cd - >/dev/null

REPORT="$REPORTS_DIR"/coding-style-reports.log.unsorted
Expand Down