Skip to content

Commit 7f59192

Browse files
author
yuzelin
committed
check
1 parent 6381a4c commit 7f59192

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

dev/check-licensing.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ if [ -z "${SOURCE_PACKAGE}" ]; then
3939
PROJECT_ROOT="${BASE_DIR}/../"
4040
cd ${PROJECT_ROOT}
4141

42+
# Sanity check to ensure that resolved paths are valid; a LICENSE file should always exist in project root
43+
if [ ! -f ${PROJECT_ROOT}/LICENSE ]; then
44+
echo "Project root path ${PROJECT_ROOT} is not valid; script may be in the wrong directory."
45+
exit 1
46+
fi
47+
4248
RUN_RAT="java -jar ${rat_jar} -E ${PROJECT_ROOT}/dev/.rat-excludes -d ${PROJECT_ROOT}"
4349
else
4450
EXTENSION='.tar.gz'
@@ -49,21 +55,18 @@ else
4955
RUN_RAT="java -jar ${rat_jar} -d ${PACKAGE_DIR}"
5056
fi
5157

52-
pwd
53-
ls
54-
5558
mkdir -p rat
5659
download_rat_jar
5760

5861
$RUN_RAT > rat/rat-results.txt
5962

60-
cat rat/rat-results.txt
61-
6263
if [ $? -ne 0 ]; then
6364
echo "RAT exited abnormally"
6465
exit 1
6566
fi
6667

68+
cat rat/rat-results.txt
69+
6770
ERRORS="$(cat rat/rat-results.txt | grep -e "??")"
6871

6972
if [[ -n "${ERRORS}" ]]; then

0 commit comments

Comments
 (0)