Skip to content

Commit

Permalink
auto should also rebuild on move events
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x committed Jul 24, 2015
1 parent 08fc9fa commit 4e0bdf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -7,6 +7,7 @@ Features
Bugfixes
--------

* auto should also rebuild in response to move events
* Don’t get metadata from file if compiler-specific metadata exist (Issue #1904)
* Fix PRETTY_URLS prompt for Windows (Issue #1901)
* Fix reST and Markdown title extraction from documents (Issue #1895, #1898)
Expand Down
7 changes: 5 additions & 2 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -259,8 +259,11 @@ def do_rebuild(self, event):
print(errord)

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

def serve_static(self, environ, start_response):
Expand Down

0 comments on commit 4e0bdf6

Please sign in to comment.