Skip to content

Commit

Permalink
Update tsp-generator.ts to protect temp file and location file for CLI (
Browse files Browse the repository at this point in the history
  • Loading branch information
dolauli committed Aug 14, 2024
1 parent 15e2490 commit 6922d41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion powershell/utils/tsp-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ async function clearOutputFiles(state: ModelState<PwshModel>) {
const resourcesFolder: string = await state.getValue('resources-folder');
const uxFolder: string = await state.getValue('ux-folder');
const readme = './README.md';
const tempTypeSpecFiles = './TempTypeSpecFiles';
const tspLocation = './tsp-location.yaml';

const protectFiles = new Set<string>();
protectFiles.add(psd1);
Expand All @@ -38,6 +40,8 @@ async function clearOutputFiles(state: ModelState<PwshModel>) {
protectFiles.add(resourcesFolder);
protectFiles.add(uxFolder);
protectFiles.add(readme);
protectFiles.add(tempTypeSpecFiles);
protectFiles.add(tspLocation);
await clearFolder(outputFolder, [...protectFiles].map((each) => resolveUri(outputFolder, each)));
}
return;
Expand All @@ -60,4 +64,4 @@ export async function generatePwshModule(pwshModel: PwshModel, emitterOptions: a
await llcsharpV2(tspService, state);
await powershellV2(tspService, state);
return;
}
}

0 comments on commit 6922d41

Please sign in to comment.