fixed dtsgen not creating target directory

canary
WolverinDEV 2018-12-04 19:24:11 +01:00
parent b584279dc7
commit 923de09df4
3 changed files with 11 additions and 4 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@ auth/js/auth.js.map
.idea/
.package-lock.json
TeaSpeakUI.tar.gz

View File

@ -1,9 +1,10 @@
import {readFileSync, writeFileSync} from "fs";
import {readFileSync, writeFileSync, mkdir} from "fs";
import {isArray, isString} from "util";
import * as ts from "typescript";
import * as decl from "./declarator";
import * as glob from "glob";
import * as path from "path";
import * as mkdirp from "mkdirp";
let source_files: string[] = [];
let exclude_files: string[] = [];
@ -87,4 +88,8 @@ source_files.forEach(file => {
});
});
mkdirp(path.normalize(path.dirname(base_path + "/" + target_file)), error => {
if(error)
throw error;
writeFileSync(base_path + "/" + target_file, result);
});