3 mainfile
="SCClassLibrary/DefaultLibrary/Main.sc"
5 # Double-check that there's exactly one in each!
6 count1
=$
( grep -c "classvar" VERSION
)
7 count2
=$
( grep -c "classvar scVersion" $mainfile )
8 if [ $count1 != 1 ] ||
[ $count2 != 1 ]; then
9 echo "ERROR in setMainVersion.sh: we require exactly one 'classvar' line to be detected. Check ../VERSION and Main.sc."
13 versionline
=$
( grep "classvar" VERSION
)
14 line
=$
( grep "classvar scVersion" $mainfile )
19 # only update if they don't already match
20 if [ "$versionline" != "$line" ]; then
21 sed "s/$line/$versionline/" <$mainfile >tempfile