fix(schematics): ensure path to file before writing
This commit is contained in:
parent
e7e9fac7d9
commit
ace390e6f7
@ -1,9 +1,11 @@
|
|||||||
import { statSync } from 'fs';
|
import { statSync } from 'fs';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
import { ensureDirSync } from 'fs-extra';
|
||||||
|
|
||||||
export function writeToFile(path: string, str: string) {
|
export function writeToFile(filePath: string, str: string) {
|
||||||
fs.writeFileSync(path, str);
|
ensureDirSync(path.dirname(filePath));
|
||||||
|
fs.writeFileSync(filePath, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user