1
1
# Inputs
2
- param ([Parameter (Mandatory )] $CONFIGURATION , [Parameter (Mandatory )] $OUTPUT , $SYMBOLOUTPUT )
2
+ param ([Parameter (Mandatory )] $Configuration , [Parameter (Mandatory )] $Output , $SymbolOutput )
3
3
4
- Write-Output " Output: $OUTPUT "
4
+ Write-Output " Output: $Output "
5
5
6
6
# Directories
7
- $THISDIR = $pwd .path
8
- $ROOT = (Get-Item $THISDIR ).parent.parent.parent .FullName
9
- $SRC = " $ROOT / src"
10
- $GCM_SRC = " $SRC / shared/ Git-Credential-Manager"
7
+ $THISDIR = $PSScriptRoot
8
+ $ROOT = (Get-Item $THISDIR ).Parent.Parent.Parent .FullName
9
+ $SRC = " $ROOT \ src"
10
+ $GCM_SRC = " $SRC \ shared\ Git-Credential-Manager"
11
11
12
12
# Perform pre-execution checks
13
- $PAYLOAD = " $OUTPUT "
14
- if ($SYMBOLOUTPUT )
13
+ $PAYLOAD = " $Output "
14
+ if ($SymbolOutput )
15
+ {
16
+ $SYMBOLS = " $SymbolOutput "
17
+ }
18
+ else
15
19
{
16
- $SYMBOLS = " $SYMBOLOUTPUT "
17
- } else {
18
20
$SYMBOLS = " $PAYLOAD .sym"
19
21
}
20
22
@@ -32,37 +34,37 @@ if (Test-Path -Path $SYMBOLS)
32
34
}
33
35
34
36
# Ensure payload and symbol directories exist
35
- mkdir - p " $PAYLOAD " , " $SYMBOLS "
37
+ mkdir - p " $PAYLOAD " , " $SYMBOLS " | Out-Null
36
38
37
39
# Publish core application executables
38
40
Write-Output " Publishing core application..."
39
41
dotnet publish " $GCM_SRC " `
40
42
-- framework net472 `
41
- -- configuration " $CONFIGURATION " `
43
+ -- configuration " $Configuration " `
42
44
-- runtime win- x86 `
43
45
-- output " $PAYLOAD "
44
46
45
47
# Delete libraries that are not needed for Windows but find their way
46
48
# into the publish output.
47
- Remove-Item - Path " $PAYLOAD /*.dylib" - Force
49
+ Remove-Item - Path " $PAYLOAD /*.dylib" - Force - ErrorAction Ignore
48
50
49
51
# Delete extraneous files that get included for other architectures
50
52
# We only care about x86 as the core GCM executable is only targeting x86
51
- Remove-Item - Path " $PAYLOAD /arm/" - Recurse - Force
52
- Remove-Item - Path " $PAYLOAD /arm64/" - Recurse - Force
53
- Remove-Item - Path " $PAYLOAD /x64/" - Recurse - Force
54
- Remove-Item - Path " $PAYLOAD /musl-x64/" - Recurse - Force
55
- Remove-Item - Path " $PAYLOAD /runtimes/win-arm64/" - Recurse - Force
56
- Remove-Item - Path " $PAYLOAD /runtimes/win-x64/" - Recurse - Force
53
+ Remove-Item - Path " $PAYLOAD /arm/" - Recurse - Force - ErrorAction Ignore
54
+ Remove-Item - Path " $PAYLOAD /arm64/" - Recurse - Force - ErrorAction Ignore
55
+ Remove-Item - Path " $PAYLOAD /x64/" - Recurse - Force - ErrorAction Ignore
56
+ Remove-Item - Path " $PAYLOAD /musl-x64/" - Recurse - Force - ErrorAction Ignore
57
+ Remove-Item - Path " $PAYLOAD /runtimes/win-arm64/" - Recurse - Force - ErrorAction Ignore
58
+ Remove-Item - Path " $PAYLOAD /runtimes/win-x64/" - Recurse - Force - ErrorAction Ignore
57
59
58
60
# The Avalonia and MSAL binaries in these directories are already included in
59
61
# the $PAYLOAD directory directly, so we can delete these extra copies.
60
- Remove-Item - Path " $PAYLOAD /x86/libSkiaSharp.dll" - Recurse - Force
61
- Remove-Item - Path " $PAYLOAD /x86/libHarfBuzzSharp.dll" - Recurse - Force
62
- Remove-Item - Path " $PAYLOAD /runtimes/win-x86/native/msalruntime_x86.dll" - Recurse - Force
62
+ Remove-Item - Path " $PAYLOAD /x86/libSkiaSharp.dll" - Recurse - Force - ErrorAction Ignore
63
+ Remove-Item - Path " $PAYLOAD /x86/libHarfBuzzSharp.dll" - Recurse - Force - ErrorAction Ignore
64
+ Remove-Item - Path " $PAYLOAD /runtimes/win-x86/native/msalruntime_x86.dll" - Recurse - Force - ErrorAction Ignore
63
65
64
66
# Delete localized resource assemblies - we don't localize the core GCM assembly anyway
65
- Get-ChildItem " $PAYLOAD " - Recurse - Include " *.resources.dll" | Remove-Item - Force
67
+ Get-ChildItem " $PAYLOAD " - Recurse - Include " *.resources.dll" | Remove-Item - Force - ErrorAction Ignore
66
68
67
69
# Delete any empty directories
68
70
Get-ChildItem " $PAYLOAD " - Recurse - Directory `
0 commit comments