Skip to content

Commit

Permalink
Ignore node_modules in file watcher (#49)
Browse files Browse the repository at this point in the history
This silences the `Listen` gem's warning "ERROR: directory is already being watched!", caused by the symlinks which pnpm uses in node_modules.
  • Loading branch information
davidtaylorhq authored Jan 9, 2025
1 parent db95c90 commit f299d04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/discourse_theme/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module DiscourseTheme
VERSION = "2.1.3"
VERSION = "2.1.4"
end
2 changes: 1 addition & 1 deletion lib/discourse_theme/watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(dir:, uploader:)

def watch
listener =
Listen.to(@dir) do |modified, added, removed|
Listen.to(@dir, ignore: %r{^node_modules/}) do |modified, added, removed|
begin
if modified.length == 1 && added.length == 0 && removed.length == 0 &&
(resolved = resolve_file(modified[0]))
Expand Down

0 comments on commit f299d04

Please sign in to comment.