Merge pull request #11029 from Microsoft/fix-write-file
add check if expected directory path is non-empty string
This commit is contained in:
commit
dd77c8c139
1 changed files with 1 additions and 1 deletions
|
@ -611,7 +611,7 @@ namespace ts {
|
||||||
const originalWriteFile = sys.writeFile;
|
const originalWriteFile = sys.writeFile;
|
||||||
sys.writeFile = function(path, data, writeBom) {
|
sys.writeFile = function(path, data, writeBom) {
|
||||||
const directoryPath = getDirectoryPath(normalizeSlashes(path));
|
const directoryPath = getDirectoryPath(normalizeSlashes(path));
|
||||||
if (!sys.directoryExists(directoryPath)) {
|
if (directoryPath && !sys.directoryExists(directoryPath)) {
|
||||||
recursiveCreateDirectory(directoryPath, sys);
|
recursiveCreateDirectory(directoryPath, sys);
|
||||||
}
|
}
|
||||||
originalWriteFile.call(sys, path, data, writeBom);
|
originalWriteFile.call(sys, path, data, writeBom);
|
||||||
|
|
Loading…
Reference in a new issue