Skip to content

Commit 2e6556b

Browse files
authored
Process site only if not in watch mode (#700)
1 parent b105795 commit 2e6556b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/jekyll-admin/file_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def write_file(path, content)
2222
File.open(path, "wb") do |file|
2323
file.write(content)
2424
end
25-
site.process
25+
conditionally_process_site
2626
end
2727

2828
# Delete the file at the given path
2929
def delete_file(path)
3030
Jekyll.logger.debug "DELETING:", path
3131
FileUtils.rm_f sanitized_path(path)
32-
site.process
32+
conditionally_process_site
3333
end
3434

3535
def delete_file_without_process(path)
@@ -39,6 +39,10 @@ def delete_file_without_process(path)
3939

4040
private
4141

42+
def conditionally_process_site
43+
site.process unless site.config['watch'] # to avoid race condition between jekyll watch and this
44+
end
45+
4246
def ensure_requested_file
4347
ensure_file(requested_file)
4448
end

0 commit comments

Comments
 (0)