File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,24 @@ steps:
59
59
inputs :
60
60
targetType : ' inline'
61
61
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
66
80
}
67
81
68
82
- task : Npm@1
You can’t perform that action at this time.
0 commit comments