Skip to content

Commit

Permalink
Ensure directory exists before writing autoupdate_version
Browse files Browse the repository at this point in the history
  • Loading branch information
staeke committed Oct 23, 2018
1 parent ebdd818 commit b3dd8e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ class MeteorImportsPlugin {
// Also kick off an async write to the output file
let outputPath = compiler.options.output.path;
const outputFile = path.join(outputPath, 'autoupdate_version');
fs.writeFile(outputFile, hash, err => {
if (err) logError('Unable to write autoupdate_version file', err);
else log('Wrote autoupdate_version file to ', outputFile);
fs.mkdir(path.dirname(outputFile), () => {
fs.writeFile(outputFile, hash, err => {
if (err) logError('Unable to write autoupdate_version file', err);
else log('Wrote autoupdate_version file to ', outputFile);
});
});
});
});
Expand Down

0 comments on commit b3dd8e2

Please sign in to comment.