Skip to content

Commit

Permalink
Fixes sintaxi#315: RangeError: Maximum call stack size exceeded when …
Browse files Browse the repository at this point in the history
…compiling large projects.
  • Loading branch information
Jorge Pedret committed Aug 13, 2014
1 parent e75c4fc commit 2f6ef07
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,22 @@ exports.compile = function(projectPath, outputPath, callback){
*/

var compileFile = function(file, done){
terra.render(file, function(error, body){
if(error){
done(error)
}else{
if(body){
var dest = path.resolve(outputPath, terraform.helpers.outputPath(file))
fs.mkdirp(path.dirname(dest), function(err){
fs.writeFile(dest, body, done)
})
process.nextTick(function () {
terra.render(file, function(error, body){
if(error){
done(error)
}else{
done()
if(body){
var dest = path.resolve(outputPath, terraform.helpers.outputPath(file))
fs.mkdirp(path.dirname(dest), function(err){
fs.writeFile(dest, body, done)
})
}else{
done()
}
}
}
})
})

}


Expand Down

0 comments on commit 2f6ef07

Please sign in to comment.