-
Notifications
You must be signed in to change notification settings - Fork 0
/
belvedere.fish
54 lines (41 loc) · 1.57 KB
/
belvedere.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Defined in - @ line 1
function belvedere --description 'Scaffolder for DNC apps. Usage: belvedere [NAME OF APP]'
# set the name
set -l name $argv[1]
# make the new directory
if test (mkdir $name)
return 1
end
# move into that directory
cd $name
# download and save the .gitignore
curl https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore >>.gitignore
# append the .gitignore
echo -e '\n# Weird Azure Stuff \nDashboard - Microsoft Azure.html\nDashboard - Microsoft Azure_files/' >>.gitignore
# create the class library
dotnet new classlib --name "$name-core"
# create the CLI
dotnet new console --name "$name-cli"
dotnet add $name-cli/*.csproj reference $name-core/
# create the web app
dotnet new razor --name $name-web
dotnet add $name-web/*.csproj reference $name-core
# create the test project
dotnet new mstest --name $name-tests
dotnet add $name-tests/*.csproj reference $name-core
dotnet add $name-tests/*.csproj reference $name-web
# create the solution
dotnet new sln --name $name
dotnet sln $name.sln add **/*.csproj
# create the README
echo "# $name" >> README.md
set -l dni (dotnet --info)
set -l dncvers $dni[2]
set -l aspncvers (string replace -r "\[.*\]" "" (string match -ir ".*aspnetcore.*" $dni))[1]
echo "Built with DotNetCore $dncvers and $aspncvers" >> README.md
git init
git add .
git commit -m "initial commit to $name"
#return to the parent directory
cd ..
end