This commit is contained in:
Amit Bergman 2021-08-16 14:06:08 +03:00
Родитель fdea0644b3
Коммит e001da9e82
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1,26 +1,30 @@
#!/bin/bash
failed=0
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
filesThatWereChanged=$(echo $(git diff origin/master --name-only))
for file in $filesThatWereChanged
#Going over all the files that were changed in this PR
#And making sure that in every file that its filename contains the word "Detection", the version was updated
do
echo processing the file $file that was changed
echo processing the file $file.
if [[ "$file" == *"Detection"* ]];
then
echo $file is a detection
diffs=$(echo $(git diff origin/master -U0 $file))
if [[ "$diffs" == *"version:"* ]];
then
echo all good - the version was updated
echo "${green}all good - the version was updated${reset}"
else
echo you **did not** change the version in this file: $file
echo "${red}You **did not** change the version in this file: $file.${reset}"
failed=1
fi
else
echo $file is not a detection
echo "${green}$file is not a detection.${reset}"
fi
done
exit $failed