aspnetcore-Vue-starter icon indicating copy to clipboard operation
aspnetcore-Vue-starter copied to clipboard

Powershell script to rename the project to something different

Open keithn opened this issue 8 years ago • 2 comments

#JustJust in case anyone needs it...

put the following into something like renameProject.ps1, then put it in the root directory of the project then just do ./renameProject.ps1 NextBigThing

Note the script will modify itself so you can rename it again if need be.

param(
[string]$projectName
)

$files = Get-ChildItem . *.* -rec -Attributes !D
foreach ($file in $files)
{
    (Get-Content $file.PSPath) |  Foreach-Object { $_ -replace "Vue2Spa", $projectName } |  Set-Content $file.PSPath
}
Rename-Item .\Vue2Spa.csproj $projectName".csproj"
Rename-Item .\Vue2Spa.sln $projectName".sln"

keithn avatar Aug 29 '17 11:08 keithn

Does it also update the namespaces within the c# files (just asking).

Nordes avatar Mar 07 '18 12:03 Nordes

You can create the project with dotnet new vuejs -n YourName. It's a standard way to give name to your projected based on a template.

SuperJMN avatar Mar 30 '18 18:03 SuperJMN