Skip to content

Commit

Permalink
Merge pull request #28 from f1sherman/env-var-to-disable
Browse files Browse the repository at this point in the history
Disable with `DISABLE_SPRING_WATCHER_LISTEN` env var
  • Loading branch information
rafaelfranca authored Sep 22, 2022
2 parents e0a3bd5 + 3459158 commit 229ff1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ On larger projects this means spring will be more responsive, more accurate and
Listen 2.7 and higher and 3.0 are supported.
If you rely on Listen 1 you can use v1.0.0 of this gem.

## Environment variables

* `DISABLE_SPRING_WATCHER_LISTEN` - If set, this disables the loading of this gem. This can be useful for projects where
some configurations do not support inotify (e.g. Docker on M1 Macs).

## Installation

Stop Spring if it's already running:
Expand Down
2 changes: 2 additions & 0 deletions lib/spring/watcher/listen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
return if ENV['DISABLE_SPRING_WATCHER_LISTEN']

require "spring/watcher"
require "spring/watcher/abstract"

Expand Down

0 comments on commit 229ff1e

Please sign in to comment.