@tsed/cli 7.3.3 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,8 +40,13 @@ export class ProjectClient extends Project {
|
|
|
40
40
|
async createSource(path, sourceFileText, options) {
|
|
41
41
|
path = join(this.rootDir, path);
|
|
42
42
|
if (path.endsWith(".ts") || path.endsWith(".mts")) {
|
|
43
|
+
await this.fs.mkdir(dirname(path));
|
|
44
|
+
if (typeof sourceFileText === "string") {
|
|
45
|
+
await this.fs.writeFile(path, sourceFileText, { encoding: "utf-8" });
|
|
46
|
+
return this.getSourceFile(path) || this.addSourceFileAtPath(path);
|
|
47
|
+
}
|
|
43
48
|
const source = this.createSourceFile(path, sourceFileText, options);
|
|
44
|
-
await source.
|
|
49
|
+
await this.fs.writeFile(path, source.getFullText(), { encoding: "utf-8" });
|
|
45
50
|
return source;
|
|
46
51
|
}
|
|
47
52
|
await this.fs.ensureDir(dirname(path));
|