github.com/mattdotmatt/gauge@v0.3.2-0.20160421115137-425a4cdccb62/build/install/macosx/scripts/backup_properties_file.sh (about)

     1  #!/bin/sh
     2  
     3  prefix=/usr/local
     4  gaugePropertiesFile=$prefix/share/gauge/gauge.properties
     5  timestamp_file=$prefix/share/gauge/timestamp.txt
     6  
     7  if [ -f $timestamp_file ] ; then
     8      currentTimeStamp=`stat -f "%m" $gaugePropertiesFile`
     9      oldTimeStamp=`cat $timestamp_file`
    10      if [ $currentTimeStamp != $oldTimeStamp ] ; then
    11          backupFile=$prefix/share/gauge/gauge.properties.bak
    12          echo "If you have Gauge installed already and there are any manual changes in gauge.properties file, a backup of it has been taken at GAUGE_INSTALL_LOCATION\share\gauge\gauge.properties.bak. You can restore these configurations later."
    13          rm -rf $backupFile
    14          cat $gaugePropertiesFile > $backupFile
    15      fi
    16  fi