# Type a script or drag a script file from your workspace to insert its path.
echo "开始检查swiftlint安装"
if ! [ -e `which swiftlint` ]
then
echo "swiftlint未安装,开始安装swiftlint"
brew intall swiftlint
fi
changeFilesArray=(`git diff --name-only head | grep '.swift$'`)
echo "一共修改了${#changeFilesArray[*]}文件"
echo ${changeFilesArray[*]}
swiftlint lint --path ${changeFilesArray[*]}