Skip to content

Commit

Permalink
actually read last_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jan 26, 2016
1 parent cd8b5ea commit a4a456a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nikola/plugins/command/deploy.py
Expand Up @@ -38,7 +38,7 @@
from blinker import signal

from nikola.plugin_categories import Command
from nikola.utils import get_logger, remove_file, unicode_str, makedirs, STDERR_HANDLER
from nikola.utils import get_logger, remove_file, makedirs, STDERR_HANDLER


class CommandDeploy(Command):
Expand All @@ -56,7 +56,7 @@ def _execute(self, command, args):
self.logger = get_logger('deploy', STDERR_HANDLER)
# Get last successful deploy date
timestamp_path = os.path.join(self.site.config['CACHE_FOLDER'], 'lastdeploy')

# Get last-deploy from persistent state
last_deploy = self.site.state.get('last_deploy')
if last_deploy is None:
Expand All @@ -65,7 +65,7 @@ def _execute(self, command, args):
if os.path.isfile(timestamp_path):
try:
with io.open(timestamp_path, 'r', encoding='utf8') as inf:
last_deploy = dateutil.parser.parse(last_deploy)
last_deploy = dateutil.parser.parse(inf.read())
clean = False
except (IOError, Exception) as e:
self.logger.debug("Problem when reading `{0}`: {1}".format(timestamp_path, e))
Expand All @@ -78,7 +78,7 @@ def _execute(self, command, args):
else:
last_deploy = dateutil.parser.parse(last_deploy)
clean = False

if self.site.config['COMMENT_SYSTEM_ID'] == 'nikolademo':
self.logger.warn("\nWARNING WARNING WARNING WARNING\n"
"You are deploying using the nikolademo Disqus account.\n"
Expand Down

0 comments on commit a4a456a

Please sign in to comment.