1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-28 03:10:45 +00:00
seahub/tests/test_seahub_changes.sh
sniper-py efa295439d github actions (#4336)
* github actions

* rm

* run dist

* fix

* rm
2019-12-09 10:46:47 +08:00

43 lines
653 B
Bash
Executable File

#!/bin/bash
test_fn()
{
FN=$1
shift;
echo "Testing $FN..."
# frontend* -> 0
patt="frontend*"
[[ $FN == $patt ]] && return 0
# media* -> 0
patt="media*"
[[ $FN == $patt ]] && return 0
# static* -> 0
patt="static*"
[[ $FN == $patt ]] && return 0
# locale* -> 0
patt="locale*"
[[ $FN == $patt ]] && return 0
return 1
}
FILES=`git diff --name-only HEAD~`
for i in $FILES
do
test_fn $i
retval=$?
if [ "$retval" == 1 ]; then
echo "File changes need to trigger tests."
exit 0
fi
done
echo "Static/media file changes should not trigger tests."
exit 1