-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·44 lines (36 loc) · 1.09 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash -l
declare -a passed_messages=()
declare -a failed_messages=()
CHECK_SIZE=2
### Check Readme
if [ -s README.md ] ; then
passed_messages+=("README.md file exists and is non-empty")
readme_check=true
else
failed_messages+=("README.md file either doesn't exist or is empty")
readme_check=false
fi
### Check License
if [ -s LICENSE ] || [ -s LICENSE.txt ] || [ -s LICENSE.md ] ; then
passed_messages+=("LICENSE file exists and is non-empty")
license_check=true
elif [ -s COPYING ] && [ -s COPYING.LESSER ] ; then
passed_messages+=("COPYING and COPYING.LESSER files exist and are non-empty (GNU LGPL)")
license_check=true
else
failed_messages+=("LICENSE file either doesn't exist or is empty")
license_check=false
fi
echo "== Passed Checks ${#passed_messages[@]} / ${CHECK_SIZE} =="
for i in "${passed_messages[@]}" ; do
echo " * ${i}"
done
echo ""
echo "== Failed Checks ${#failed_messages[@]} / ${CHECK_SIZE} =="
for i in "${failed_messages[@]}" ; do
echo " * ${i}"
done
if [ $readme_check = false ] || [ $license_check = false ] ; then
exit 1
fi
exit 0