- license="No Apache license found"
- if [ -f $file ]; then
- if [ -s $file ]; then
- if [ $(grep -c "http://www.apache.org/licenses/LICENSE-2.0" $file) -ge 1 ] ; then
- license="Apache-2.0"
+
+ file_type=$(file -b --mime-type $file | sed 's|/.*||')
+ echo $file is $file_type
+ case "$file_type" in
+ text)
+ binary=false
+ ;;
+ *)
+ binary=true
+ ;;
+ esac
+
+ if $binary ; then
+ license=Binary
+ else
+ license="No Apache license found"
+ if [ -f $file ]; then
+ if [ -s $file ]; then
+ if [ $(grep -c "http://www.apache.org/licenses/LICENSE-2.0" $file) -ge 1 ] ; then
+ license="Apache-2.0"
+ fi