From c5a7106563f66a8744f817451bcb7c6a9ce5cb44 Mon Sep 17 00:00:00 2001 From: Niels Kooiman Date: Fri, 26 Mar 2021 23:02:36 +0100 Subject: [PATCH] Ask project name + confirm, copy files --- kickstart.ps1 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/kickstart.ps1 b/kickstart.ps1 index 8d92178..6551788 100644 --- a/kickstart.ps1 +++ b/kickstart.ps1 @@ -1,5 +1,14 @@ -New-Item -ItemType Directory -Force -Path output -pushd output +$AppName = Read-Host -Prompt 'Input your project (folder) name' +$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 # solution dotnet new sln -n Solution @@ -30,4 +39,12 @@ dotnet new console -n ConsoleApp dotnet sln add ConsoleApp dotnet add ConsoleApp reference Domain dotnet add ConsoleApp reference Wiring -popd \ No newline at end of file +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" \ No newline at end of file