Skip to content

Commit 4e0bdf6

Browse files
committedJul 24, 2015
auto should also rebuild on move events
1 parent 08fc9fa commit 4e0bdf6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

Diff for: ‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Features
77
Bugfixes
88
--------
99

10+
* auto should also rebuild in response to move events
1011
* Don’t get metadata from file if compiler-specific metadata exist (Issue #1904)
1112
* Fix PRETTY_URLS prompt for Windows (Issue #1901)
1213
* Fix reST and Markdown title extraction from documents (Issue #1895, #1898)

Diff for: ‎nikola/plugins/command/auto/__init__.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,11 @@ def do_rebuild(self, event):
259259
print(errord)
260260

261261
def do_refresh(self, event):
262-
self.logger.info('REFRESHING: {0}'.format(event.src_path))
263-
p = os.path.relpath(event.src_path, os.path.abspath(self.site.config['OUTPUT_FOLDER']))
262+
# Move events have a dest_path, some editors like gedit use a
263+
# move on larger save operations for write protection
264+
event_path = event.dest_path if event.dest_path else event.src_path
265+
self.logger.info('REFRESHING: {0}'.format(event_path))
266+
p = os.path.relpath(event_path, os.path.abspath(self.site.config['OUTPUT_FOLDER']))
264267
refresh_signal.send(path=p)
265268

266269
def serve_static(self, environ, start_response):

0 commit comments

Comments
 (0)