drewdeponte / sublime_guard

Sublime Text 2 Guard Plugin - helps create a smoother development workflow.
MIT License
175 stars 15 forks source link

Allow for the --force-polling guard parameter. #77

Open davidhooey opened 10 years ago

davidhooey commented 10 years ago

On some systems the rb-fsevent gem is not doing its job and the --force-polling parameter is required. I hacked the script to allow for --force-polling.

function run_guard() {
  cmd="guard --force-polling"
  cd "$1"
  if [[ $? -eq 0 ]] ; then
    if [[ -s "Gemfile" ]] ; then
      cmd="bundle exec guard --force-polling"
    fi
    printf "Running '$cmd'. All output/failures from this point on is from the '$cmd' command.\n\n"
    $cmd
  else
    printf "Failed to change into project root directory '$1', guard could not be started.\n\n"
  fi
}