Skip to content

Instantly share code, notes, and snippets.

@rhwy
Created March 9, 2020 00:25
Show Gist options
  • Save rhwy/8d2bba57d7a1004ff24cb03a00d37402 to your computer and use it in GitHub Desktop.
Save rhwy/8d2bba57d7a1004ff24cb03a00d37402 to your computer and use it in GitHub Desktop.
A very simple script to build generic template to keep on top of your dotnet exercices folder that allows you to quickly scaffold solution and projects structure
mkdir $1
cd $1
git init
echo "bin" >> .gitignore
echo "obj" >> .gitignore
git config core.autocrlf false
git add -A && git commit -m "init repo with gitignore"
mkdir src
mkdir src/$1.App
mkdir src/$1.Core
mkdir src/$1.Tests
dotnet new sln
dotnet new console -o src/$1.App
dotnet new classlib -o src/$1.Core
dotnet new xunit -o src/$1.Tests
dotnet sln add src/$1.App/$1.App.csproj
dotnet sln add src/$1.Core/$1.Core.csproj
dotnet sln add src/$1.Tests/$1.Tests.csproj
dotnet add src/$1.App reference src/$1.Core/$1.Core.csproj
dotnet add src/$1.Tests reference src/$1.Core/$1.Core.csproj
dotnet build
git add -A && git commit -m "initialized structure of the project"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment