Skip to content

Commit 3e35a38

Browse files
committed
Update cleaning of files for ccs to avoid deleting folders in core lib
1 parent 6337034 commit 3e35a38

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.azure-pipelines/generation-templates/ccs-typescript-sdk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ parameters:
33
type: string
44
- name: packageName
55
type: string
6-
default: '@microsoft/copilot-beta-sdk'
6+
default: '@microsoft/agents-m365copilot'
77

88
steps:
9-
- pwsh: '$(scriptsDirectory)/clean-typescript-files.ps1 -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/" -packageName "${{ parameters.packageName }}"'
9+
- pwsh: '$(scriptsDirectory)/clean-typescript-ccs-files.ps1 -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/" -packageName "${{ parameters.packageName }}"'
1010
displayName: 'Remove generated models and requests from the repo folder'
1111

1212
- pwsh: '$(scriptsDirectory)/copy-ccs-typescript-sdk-models.ps1 -sourceDirectory "$(kiotaDirectory)/output/*" -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/" -packageName "${{ parameters.packageName }}"'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
param (
2+
[Parameter(Mandatory = $true)]
3+
[string]
4+
$targetDirectory,
5+
[string]
6+
$packageName = "@microsoft/agents-m365copilot",
7+
[Parameter(Mandatory = $true)]
8+
[string]
9+
$folderToClean
10+
)
11+
Push-Location $targetDirectory
12+
13+
$kiotaLockFileName = "kiota-lock.json"
14+
$folderToCleanPath = Join-Path $targetDirectory -ChildPath $folderToClean
15+
16+
# Check if the folder to clean exists
17+
if (Test-Path $folderToCleanPath) {
18+
Write-Host "Cleaning contents in: $folderToClean" -ForegroundColor Cyan
19+
Push-Location $folderToCleanPath
20+
Get-ChildItem -Directory | ForEach-Object { Remove-Item -r $_.FullName }
21+
Remove-Item $kiotaLockFileName -ErrorAction SilentlyContinue -Verbose
22+
Pop-Location
23+
Write-Host "Successfully cleaned contents in: $folderToClean" -ForegroundColor Green
24+
} else {
25+
Write-Host "Warning: Folder '$folderToClean' does not exist in the target directory." -ForegroundColor Yellow
26+
}
27+
28+
Pop-Location
29+
Write-Host "Cleaning operation completed for target: $folderToClean" -ForegroundColor Green

0 commit comments

Comments
 (0)