-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease_command.ps1
48 lines (41 loc) · 1.09 KB
/
release_command.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
39
40
41
42
43
44
45
46
47
48
param([string]$runMethod)
if ($runMethod -ne "toolScript") {
$ExecutePath = $PWD
Set-Location $PSScriptRoot
Set-Location ..
. ./shell/global_tools.ps1
}
# 打包命令项目
PrintLineSplit
Write-Host "[Release Command]:";
$cpath = ConfigFileHandle("./_configs/command.config")
if ($cpath -and (Test-Path $cpath)) {
$save_path = "./_release/command_packages"
if ($save_path -and (Test-Path $save_path)) {
Remove-Item -Recurse -Force $save_path
}
$list = Get-Content $cpath
for ($i = 0; $i -lt $list.Count; $i++) {
if ($list.Count -eq 1) {
$item = $list;
}
else {
$item = $list[$i]
}
if (!$item) {
continue;
}
PrintLineSplit
# 打包项目
Write-Output "dotnet build $item"
dotnet build $item
Write-Output "dotnet pack $item --output '$save_path'"
dotnet pack $item --output "$save_path"
}
}
if ($runMethod -ne "toolScript") {
Set-Location $ExecutePath
if ($PSScriptRoot -eq $ExecutePath) {
timeout.exe /T -1
}
}