Commit daa0ac2f by Nate Hardison

Capture Mako exit code and fail fast if necessary

Capture the exit code of the Mako template engine invocation on
asset preprocessing and abort from the Rake task on failure. This
will prevent the LMS from continuing its attempt to start up,
preventing further configuration errors.
parent f8261982
......@@ -19,9 +19,11 @@ def preprocess_with_mako(filename)
# strip off the .mako extension
output_filename = filename.chomp(File.extname(filename))
# just pipe from stdout into the new file
# just pipe from stdout into the new file, exiting on failure
File.open(output_filename, 'w') do |file|
file.write(`python -c '#{mako}'`)
exit_code = $?.to_i
abort "#{mako} failed with #{exit_code}" if exit_code.to_i != 0
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment