Skip to content

Commit

Permalink
MIN Make fix-mtimes.py robust
Browse files Browse the repository at this point in the history
  • Loading branch information
luispedro committed May 12, 2018
1 parent bb2fd8d commit 0526827
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.sass-cache
_site
mtime_hash.pkl
7 changes: 5 additions & 2 deletions fix-mtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ def hash_file(fname):
s.update(ifile.read())
return s.hexdigest()

with open(HASH_CACHE_FILE, 'rb') as ifile:
previous = pickle.load(ifile)
if path.exists(HASH_CACHE_FILE):
with open(HASH_CACHE_FILE, 'rb') as ifile:
previous = pickle.load(ifile)
else:
previous = {}

current = {}
for root, _, files in walk('_site'):
Expand Down

0 comments on commit 0526827

Please sign in to comment.