Skip to content

Commit

Permalink
create missing output dir as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
blai committed Sep 14, 2015
1 parent 325aeae commit 2e3cbeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"babel-runtime": "^5.8.24",
"dox": "^0.8.0",
"globby": "^3.0.0",
"mkdirp": "^0.5.1",
"react-docgen": "^2.1.0",
"yargs": "^3.24.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import path from 'path';
import fs from 'fs';
import mkdirp from 'mkdirp';

export function generateManifest(options, items) {
if (options.dest) {
Expand All @@ -10,6 +11,7 @@ export function generateManifest(options, items) {
let contents = `module.exports = [${items}];`;

if (options.dest) {
mkdirp.sync(path.dirname(options.dest));
fs.writeFileSync(options.dest, contents);
} else {
console.log(contents);
Expand Down

0 comments on commit 2e3cbeb

Please sign in to comment.