Skip to content

Commit

Permalink
Force overwriting of dot-files on new repos
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlydog committed Apr 8, 2024
1 parent 6b21f0a commit b648116
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ function CopyTemplateFilesToRepositoryRoot([string] $repositoryDirectoryPath)
$repoDotFiles = Get-ChildItem -Path $repositoryDirectoryPath -Recurse -Force -Filter '_.*'
$repoDotFiles | ForEach-Object {
[string] $filePath = $_.FullName
[string] $parentDirectory = Split-Path -Path $filePath -Parent
[string] $newFileName = $_.Name -replace '^_\.', '.'
Rename-Item -Path $filePath -NewName $newFileName -Force
[string] $newFilePath = Join-Path -Path $parentDirectory -ChildPath $newFileName
Move-Item -Path $filePath -Destination $newFilePath -Force
}
}

Expand Down

0 comments on commit b648116

Please sign in to comment.