Hi, your plugin is really helping me out. But I stumble upon a bug when calling addOutputFile
with a relative path including a nested path.
Error: ENOENT: no such file or directory, open '{my-project}\test\fixtures\tmp\route_template_generator_filter-output_path-JXh9JtNw.tmp\sub\file.hbs'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at addOutputFile (node_modules\broccoli-multi-filter\index.js:136:8)
... my stack ...
addOutputFile(newContent, path.join(relativePath, '..', 'sub', 'file.hbs'));
I debugged this problem and found a fix, it is up to you whether this is acceptable:
Next snippet is from index.js#131
function addOutputFile(contents, outputRelativeFilename) {
var outputPath = path.join(destDir, outputRelativeFilename);
+ mkdirp.sync(path.dirname(outputPath));
fs.writeFileSync(outputPath, contents, { encoding: self.outputEncoding });
cacheEntry.results.push({
output: destDir + '/' + outputRelativeFilename,
cache: self.cachePath + '/' + outputRelativeFilename
});
}