Ask project name + confirm, copy files
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
New-Item -ItemType Directory -Force -Path output
|
$AppName = Read-Host -Prompt 'Input your project (folder) name'
|
||||||
pushd output
|
$TargetFolder="../$AppName"
|
||||||
|
Write-Host "Creating a new project '$AppName' in '$TargetFolder'"
|
||||||
|
$confirmation = Read-Host "Are you sure you want to proceed? [y/N]"
|
||||||
|
if ($confirmation -ne 'y') {
|
||||||
|
Write-Host "Closing.."
|
||||||
|
Start-Sleep -Seconds 2
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
New-Item -ItemType Directory -Force -Path $TargetFolder
|
||||||
|
Push-Location $TargetFolder
|
||||||
git init
|
git init
|
||||||
# solution
|
# solution
|
||||||
dotnet new sln -n Solution
|
dotnet new sln -n Solution
|
||||||
@@ -30,4 +39,12 @@ dotnet new console -n ConsoleApp
|
|||||||
dotnet sln add ConsoleApp
|
dotnet sln add ConsoleApp
|
||||||
dotnet add ConsoleApp reference Domain
|
dotnet add ConsoleApp reference Domain
|
||||||
dotnet add ConsoleApp reference Wiring
|
dotnet add ConsoleApp reference Wiring
|
||||||
popd
|
Pop-Location
|
||||||
|
|
||||||
|
# copy content files
|
||||||
|
Copy-Item -Path "files/AssemblyInfo.cs" -Destination "$TargetFolder/Domain"
|
||||||
|
Copy-Item -Path "files/DomainPorts.cs" -Destination "$TargetFolder/Domain"
|
||||||
|
Copy-Item -Path "files/IAdapterResolver.cs" -Destination "$TargetFolder/Domain"
|
||||||
|
Copy-Item -Path "files/Wiring.cs" -Destination "$TargetFolder/Wiring"
|
||||||
|
|
||||||
|
Write-Host "Finished"
|
||||||
Reference in New Issue
Block a user