Skip to content

Commit

Permalink
Warn when lessc/sass are missing.
Browse files Browse the repository at this point in the history
(fix getnikola/nikola-themes#24)

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Nov 13, 2013
1 parent 6dbec24 commit da9b688
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion nikola/plugins/task/build_less.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ def gen_tasks(self):
def compile_target(target, dst):
utils.makedirs(dst_dir)
src = os.path.join(kw['cache_folder'], self.sources_folder, target)
compiled = subprocess.check_output([self.compiler_name, src])
try:
compiled = subprocess.check_output([self.compiler_name, src])
except OSError:
utils.req_missing([self.compiler_name],
'build LESS files (and use this theme)',
False, False)
with open(dst, "wb+") as outf:
outf.write(compiled)

Expand Down
7 changes: 6 additions & 1 deletion nikola/plugins/task/build_sass.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ def gen_tasks(self):
def compile_target(target, dst):
utils.makedirs(dst_dir)
src = os.path.join(kw['cache_folder'], self.sources_folder, target)
compiled = subprocess.check_output([self.compiler_name, src])
try:
compiled = subprocess.check_output([self.compiler_name, src])
except OSError:
utils.req_missing([self.compiler_name],
'build Sass files (and use this theme)',
False, False)
with open(dst, "wb+") as outf:
outf.write(compiled)

Expand Down

0 comments on commit da9b688

Please sign in to comment.