Skip to content

Commit e0cbc67

Browse files
committedFeb 7, 2015
fix #1615 -- make deploy work after removing cache
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 883cd39 commit e0cbc67

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Features
1010
Bugfixes
1111
--------
1212

13+
* Fix ``nikola deploy`` when there is no cache (Issue #1615)
1314
* Report issues in scale_images properly (Issue #1598)
1415
* Correctly read sub-timezones in ``nikola init`` (via Issue #1599)
1516
* Fix zoneinfo reading in ``nikola init`` (Issue #1599)

‎nikola/plugins/command/deploy.py

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def _execute(self, command, args):
111111
new_deploy = datetime.utcnow()
112112
self._emit_deploy_event(last_deploy, new_deploy, clean, undeployed_posts)
113113

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

4 commit comments

Comments
 (4)

kayhayen commented on Feb 7, 2015

@kayhayen
Contributor

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

Kwpolska commented on Feb 7, 2015

@Kwpolska
MemberAuthor

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 commented on Feb 7, 2015

@kayhayen
Contributor

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 commented on Feb 7, 2015

@Kwpolska
MemberAuthor

Code review is certainly welcome.

Please sign in to comment.