Skip to content

Commit dd1a2d9

Browse files
Fix issue where Rename-Item would fail when generating solution with PowerShell
This would cause the 'heads' directory to not be named properly and cause subtle issues that would be unnoticed. This should be more resilient now and not prone to problems and conflicts with file handles. End behavior is exactly the same.
1 parent 38728ba commit dd1a2d9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ProjectHeads/GenerateSingleSampleHeads.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ dotnet new --install "$PSScriptRoot/SingleComponent" --force
5252
Push-Location $componentPath
5353

5454
# Copy and rename projects
55-
dotnet new ct-tooling-heads -n $componentName
56-
57-
# Rename folder from component name (dotnet tooling default) to 'heads'
58-
Rename-Item -Path "$componentName" -NewName $headsFolderName -Force
55+
# Set output folder to 'heads' instead of default
56+
dotnet new ct-tooling-heads -n $componentName -o $headsFolderName
5957

6058
# Remove template, as just for script
6159
dotnet new --uninstall "$PSScriptRoot/SingleComponent"

0 commit comments

Comments
 (0)