misc/sf
changeset 341 e9d5287c3107
equal deleted inserted replaced
340:9eeab89d0671 341:e9d5287c3107
       
     1 #!/bin/sh
       
     2 ###set -e
       
     3 
       
     4 trap "exit" INT
       
     5 
       
     6 function scala_compile {
       
     7   (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null) 
       
     8 }
       
     9 
       
    10 
       
    11 
       
    12 files=${1:-assignment2019scala-*/Part10}
       
    13 
       
    14 name="bf.scala"
       
    15 
       
    16 for sd in $files; do
       
    17     scalafix -r DisableSyntax --settings.DisableSyntax.noVars=true --settings.DisableSyntax.noReturns=true --settings.DisableSyntax.noWhileLoops=true $sd/$name 2> /dev/null 1> /dev/null
       
    18    ts=$(( $? )) 
       
    19    if [ $ts -ne 0 ]
       
    20    then
       
    21      echo $sd  
       
    22      echo $ts
       
    23    else
       
    24        if (scala_compile $sd/$name)
       
    25        then	  
       
    26          ts=$(( 0 ))
       
    27        else
       
    28          echo $sd  
       
    29          echo $ts  
       
    30        fi	   
       
    31    fi  
       
    32 done
       
    33 
       
    34 
       
    35