Skip to content

Commit

Permalink
fix(schematics): ensure path to file before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio-martinez authored and vsavkin committed Nov 18, 2018
1 parent e7e9fac commit ace390e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/schematics/src/utils/fileutils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { statSync } from 'fs';
import * as fs from 'fs';
import * as path from 'path';
import { ensureDirSync } from 'fs-extra';

export function writeToFile(path: string, str: string) {
fs.writeFileSync(path, str);
export function writeToFile(filePath: string, str: string) {
ensureDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, str);
}

/**
Expand Down

0 comments on commit ace390e

Please sign in to comment.