Skip to content

Commit da263fd

Browse files
authored
Merge pull request #2 from chris02pap/main
have merged this PR for now as it is potentially useful do not personally have environment to test - however others will test that it has equivalent functionality to the bash version `setup.sh` and amend if necessary
2 parents 68748b6 + c387f10 commit da263fd

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

CustomizeTemplate.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
param (
2+
[Parameter(Mandatory=$true)]
3+
[string]$NewDM
4+
)
5+
6+
$Root = Get-Location
7+
Write-Host "Customizing template for DM: $NewDM"
8+
9+
Get-ChildItem -Path $Root -Recurse -File -Filter "TemplateDM*" | ForEach-Object {
10+
$NewName = $_.Name -replace "TemplateDM", $NewDM
11+
Rename-Item -Path $_.FullName -NewName $NewName
12+
Write-Host "Renamed: $($_.FullName) -> $NewName"
13+
}
14+
15+
$FilesToEdit = @(
16+
"settings.gradle.kts",
17+
"vo-dml/$NewDM-v1.vodml-binding.xml",
18+
"doc/std/$NewDM.tex",
19+
"doc/site/index.md"
20+
)
21+
22+
foreach ($File in $FilesToEdit) {
23+
$FullPath = Join-Path $Root $File
24+
if (Test-Path $FullPath) {
25+
(Get-Content $FullPath) -replace "TemplateDM", $NewDM | Set-Content $FullPath
26+
Write-Host "Updated file: $FullPath"
27+
}
28+
}
29+
30+
Write-Host "Done"

0 commit comments

Comments
 (0)