Skip to content

Commit

Permalink
add action to open sln automatically, plus --noopensln switch
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentH-Net committed Feb 28, 2023
1 parent 47c68ba commit 96a2457
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Orleans.Multiservice/TemplatePostAction.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Start-Sleep -seconds 1 # Workaround to prevent exception from lock on dotnet.exe
dotnet add Apis/Apis.csproj reference LogicalserviceNameService/LogicalserviceNameService.csproj

Write-Host "Use AddLogicalService.ps1 <name> to add more logical services" -ForegroundColor White -BackgroundColor DarkBlue
Remove-Item $PSCommandPath -Force
Remove-Item "$PSCommandPath" -Force
33 changes: 29 additions & 4 deletions src/WinUI3-App/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@
"dataType": "bool",
"defaultValue": "false",
"description": "Omits the .editorconfig used to build this template"
},
"noopensln": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false",
"description": "Skips opening the solution"
}
},
"primaryOutputs": [
Expand Down Expand Up @@ -341,7 +347,13 @@
{
"condition": "(noeditorconfig)",
"exclude": [
"TemplatePostAction.ps1"
"AddMcsEditorConfig.ps1"
]
},
{
"condition": "(noopensln)",
"exclude": [
"OpenSolution.ps1"
]
}
]
Expand All @@ -361,16 +373,29 @@
},
{
"condition": "(!noeditorconfig)",
"description": "Add the .editorconfig that was used to build this template",
"description": "run 'dotnet new mcs-editorconfig' to add the .editorconfig that was used to build this template",
"manualInstructions": [ { "text": "To add the .editorconfig that was used to build this template, run 'dotnet new mcs-editorconfig'" } ],
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "powershell",
"args": "-file TemplatePostAction.ps1",
"args": "-file AddMcsEditorConfig.ps1",
"redirectStandardError": false,
"redirectStandardOutput": false
},
"continueOnError": true
},
{
"condition": "(!noopensln)",
"description": "Open the solution",
"manualInstructions": [ { "text": "Open UnoWinUIQuickStart.sln" } ],
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "powershell",
"args": "-file OpenSolution.ps1",
"redirectStandardError": false,
"redirectStandardOutput": false
},
"continueOnError": false
"continueOnError": true
}
]
}
File renamed without changes.
5 changes: 5 additions & 0 deletions src/WinUI3-App/OpenSolution.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$solutionfolder = Split-Path -Path "$PSCommandPath" -Parent
$solutionpath = Join-Path -Path $solutionfolder -ChildPath "UnoWinUIQuickStart.sln"
& "$solutionpath"

Remove-Item "$PSCommandPath" -Force

0 comments on commit 96a2457

Please sign in to comment.