-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.ps1
38 lines (32 loc) · 1.31 KB
/
create.ps1
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
[string] $Path = (Get-Location).Path
[string] $Name = "BlogNetNicaragua"
[string] $ModuleName = "BlogModule"
[string] $ThemeName = "Blog.Theme"
[string] $NuGetSource
Process
{
if ([string]::IsNullOrEmpty($NuGetSource))
{
dotnet new install OrchardCore.ProjectTemplates::1.6.0
}
else
{
dotnet new install OrchardCore.ProjectTemplates::1.6.0 --nuget-source $NuGetSource
}
dotnet new occms -o "$Path/src/$Name.Web"
dotnet new sln -o "$Path" -n "$Name"
dotnet sln "$Path/$Name.sln" add "$Path/src/$Name.Web/$Name.Web.csproj"
if (![string]::IsNullOrEmpty($ModuleName))
{
dotnet new ocmodulecms -n "$ModuleName" -o "$Path/src/Modules/$ModuleName"
dotnet add "$Path/src/$Name.Web/$Name.Web.csproj" reference "$Path/src/Modules/$ModuleName/$ModuleName.csproj"
dotnet sln "$Path/$Name.sln" add "$Path/src/Modules/$ModuleName/$ModuleName.csproj"
}
if (![string]::IsNullOrEmpty($ThemeName))
{
dotnet new octheme -n "$ThemeName" -o "$Path/src/Themes/$ThemeName"
dotnet add "$Path/src/$Name.Web/$Name.Web.csproj" reference "$Path/src/Themes/$ThemeName/$ThemeName.csproj"
dotnet sln "$Path/$Name.sln" add "$Path/src/Themes/$ThemeName/$ThemeName.csproj"
}
Copy-Item "$PSScriptRoot\.gitignore" -Destination "$Path\.gitignore"
}