Skip to content

Commit

Permalink
More useful error message in case coffee is not installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jMyles committed Jul 19, 2012
1 parent 6eb3d10 commit 00f8923
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion coffeescript/templatetags/coffeescript.py
Expand Up @@ -77,8 +77,11 @@ def coffeescript(path):
source_file.close()

args = shlex.split("%s -c -s -p" % COFFEESCRIPT_EXECUTABLE, posix=POSIX_COMPATIBLE)
p = subprocess.Popen(args, stdin=subprocess.PIPE,
try:
p = subprocess.Popen(args, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except OSError:
raise RuntimeError('CoffeeScript Executable not found. Is it installed in your OS?')
out, errors = p.communicate(source)
if out:
if not os.path.exists(output_directory):
Expand Down

0 comments on commit 00f8923

Please sign in to comment.