Skip to content

Commit cfa795a

Browse files
committed
fix(cd): if this works I am a donkey
1 parent 1f6cf3d commit cfa795a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

azure-devops/templates/cd-template.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,24 @@ steps:
5959
inputs:
6060
targetType: 'inline'
6161
script: |
62-
# List of files to update
63-
Get-ChildItem -Path . -Recurse -File | ForEach-Object {
64-
(Get-Content -Path $file) -replace '''igniteui-angular''', '''@infragistics/igniteui-angular''' | Set-Content -Path $file
65-
(Get-Content -Path $file) -replace '"igniteui-angular"', '"@infragistics/igniteui-angular"' | Set-Content -Path $file
62+
$mainDirectory = "."
63+
$subDirs = @("projects", "src")
64+
$oldStrings = @("'igniteui-angular'", """igniteui-angular""") # Strings to replace
65+
$newStrings = @("'@infragistics/igniteui-angular'", """@infragistics/igniteui-angular""")
66+
$files = Get-ChildItem -Path $mainDirectory -File
67+
foreach ($subDir in $subDirs) {
68+
$subDirPath = Join-Path -Path $mainDirectory -ChildPath $subDir
69+
if (Test-Path $subDirPath) {
70+
$files += Get-ChildItem -Path $subDirPath -File -Recurse
71+
}
72+
}
73+
foreach ($file in $files) {
74+
$filePath = $file.FullName
75+
$content = Get-Content -Path $filePath -Raw
76+
for ($i = 0; $i -lt $oldStrings.Count; $i++) {
77+
$content = $content -replace [regex]::Escape($oldStrings[$i]), $newStrings[$i]
78+
}
79+
Set-Content -Path $filePath -Value $content
6680
}
6781
6882
- task: Npm@1

0 commit comments

Comments
 (0)