Skip to content
Permalink
Browse files
fix #1615 -- make deploy work after removing cache
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 7, 2015
1 parent 883cd39 commit e0cbc676b346084d623806cb79beac539912ef64
Showing with 2 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +1 −0 nikola/plugins/command/deploy.py
@@ -10,6 +10,7 @@ Features
Bugfixes
--------

* Fix ``nikola deploy`` when there is no cache (Issue #1615)
* Report issues in scale_images properly (Issue #1598)
* Correctly read sub-timezones in ``nikola init`` (via Issue #1599)
* Fix zoneinfo reading in ``nikola init`` (Issue #1599)
@@ -111,6 +111,7 @@ def _execute(self, command, args):
new_deploy = datetime.utcnow()
self._emit_deploy_event(last_deploy, new_deploy, clean, undeployed_posts)

os.makedirs(self.site.config['CACHE_FOLDER'])
# Store timestamp of successful deployment
with io.open(timestamp_path, 'w+', encoding='utf8') as outf:
outf.write(unicode_str(new_deploy.isoformat()))

4 comments on commit e0cbc67

@kayhayen

This comment has been minimized.

Copy link
Contributor

@kayhayen kayhayen replied Feb 7, 2015

Maybe better to use os.path.dirname(timestamp_path), as you are violating "DRY" there.

@Kwpolska

This comment has been minimized.

Copy link
Member Author

@Kwpolska Kwpolska replied Feb 7, 2015

Why bother? We know timestamp_path is in the cache folder, we don’t plan to move it, better to just use this and call it a day.

@kayhayen

This comment has been minimized.

Copy link
Contributor

@kayhayen kayhayen replied Feb 7, 2015

Oh, I wasn't suggesting to change it. It's just that "knowing" comes into play when you repeat yourself, and that can be avoided. That is why "DRY" comes into play for me. Just a comment, no demand.

Seeing code:

os.makedirs(some_dirname)
open(some_filename, "w")

requires that the reader knows the relationship between some_file and some_dir. Using

os.makedirs(dirname(some_filename))
open(some_filename, "w")

on the other hand, is pretty much immediately recognizable.

Again, just a comment, because I looked at the commit. If code review is not welcome, make that clear some prominent place.

@Kwpolska

This comment has been minimized.

Copy link
Member Author

@Kwpolska Kwpolska replied Feb 7, 2015

Code review is certainly welcome.

Please sign in to comment.