Skip to content

Commit 1f7fa79

Browse files
Update install as tool (#100)
* Improve install-as-tool.ps1 * Add comment about expected output * Prevent uninstalling an existing tool if build fails * Update install-as-tool.ps1 Co-authored-by: Eirik Tsarpalis <[email protected]> Co-authored-by: Eirik Tsarpalis <[email protected]>
1 parent f144bf7 commit 1f7fa79

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

install-as-tool.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ Push-Location $(Split-Path $MyInvocation.MyCommand.Path)
55

66
$ARTIFACTS_DIR = "artifacts"
77
$BUILD_CONFIGURATION = "Release"
8+
$APP_NAME = "DocsPortingTool"
9+
$EXE_PROJECT = "Program"
810

9-
dotnet pack -c $BUILD_CONFIGURATION -o $ARTIFACTS_DIR "Program"
10-
dotnet tool update --global --add-source $ARTIFACTS_DIR "DocsPortingTool"
11+
dotnet clean -c $BUILD_CONFIGURATION; remove-item -Recurse -ErrorAction Ignore $ARTIFACTS_DIR
12+
dotnet pack -c $BUILD_CONFIGURATION -o $ARTIFACTS_DIR $EXE_PROJECT
13+
14+
If ($LASTEXITCODE -ne 0)
15+
{
16+
Write-Output "$APP_NAME will not be installed/upgraded."
17+
Exit
18+
}
19+
20+
dotnet tool update --global --add-source $ARTIFACTS_DIR $APP_NAME

0 commit comments

Comments
 (0)