Revert "tsp - add support for output-folder (#1364)" (#1365)

This reverts commit 2a1537bccd.
This commit is contained in:
Xiaogang 2024-07-31 09:14:53 +08:00 коммит произвёл GitHub
Родитель 2a1537bccd
Коммит 41946e4499
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -7,13 +7,11 @@ import { Channel, AutorestExtensionHost as Host, JsonPointerSegments as JsonPath
import { safeEval, deserialize, Initializer, DeepPartial } from '@azure-tools/codegen';
import { Dictionary } from '@azure-tools/linq';
import { TspHost, TspHostImpl } from './tsp-host';
import { join } from 'path';
export class ModelState<T extends Dictionary<any>> extends Initializer {
public model!: T;
protected documentName!: string;
protected currentPath: JsonPath = new Array<string>();
protected outputFolder!: string;
private context!: any;
private _debug = false;
private _verbose = false;
@ -26,7 +24,6 @@ export class ModelState<T extends Dictionary<any>> extends Initializer {
async init(project?: any) {
if (this.service instanceof TspHostImpl) {
// skip init for tsp
this.outputFolder = await this.getValue('output-folder', './generated');
this.initContext(project);
return this;
}
@ -98,7 +95,7 @@ export class ModelState<T extends Dictionary<any>> extends Initializer {
return this.service.protectFiles(path);
}
writeFile(filename: string, content: string, sourceMap?: undefined, artifactType?: string | undefined): void {
return this.service.writeFile({ filename: join(this.outputFolder, filename), content: content, sourceMap: sourceMap, artifactType: artifactType });
return this.service.writeFile({ filename: filename, content: content, sourceMap: sourceMap, artifactType: artifactType });
}
message(message: Message): void {