1. #!/bin/sh
  2.  
  3. ref=$(git symbolic-ref HEAD 2> /dev/null)
  4. if [[ -n $ref ]]; then
  5.  
  6. if [[ $ref =~ "master" ]]; then
  7. rm public/.htaccess
  8. else
  9. echo "RailsEnv ${ref#refs/heads/}" > public/.htaccess
  10. fi
  11. touch tmp/restart.txt
  12. fi