From 5cd86228b3c7ec7924a56a4fe02a1a5008eec181 Mon Sep 17 00:00:00 2001 From: dark Date: Tue, 24 Dec 2024 02:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go-release-set.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go-release-set.ps1 b/go-release-set.ps1 index 32603f6..77d7bc4 100644 --- a/go-release-set.ps1 +++ b/go-release-set.ps1 @@ -1,7 +1,7 @@ # powershell 脚本,等待输入ID -$Type = Read-Host "input deploy type(api/web):" +$Type = Read-Host "input deploy type(api/web/service):" # 如果输入不是api或者web,则退出 -if ($Type -ne "api" -and $Type -ne "web") { +if ($Type -ne "api" -and $Type -ne "web" -and $Type -ne "service") { Write-Host "error, input must be api or web" exit } @@ -28,9 +28,12 @@ Invoke-WebRequest https://gitea.gxxhygroup.com/dark/gotools/raw/branch/master/re # 获取swagger.bat, Invoke-WebRequest https://gitea.gxxhygroup.com/dark/gotools/raw/branch/master/swagger.bat -o swagger.bat +# 使用文件名替换swagger.bat中的HostNameForReplace +$files | ForEach-Object { (Get-Content 'swagger.bat') -replace 'HostNameForReplace', $_ | Set-Content 'swagger.bat' } # $files去除字符串中的-,赋值给变量 $filesjson = $files -replace '-', '' # 再去除字符串最后的api或者web $filesjson = $filesjson -replace 'api', '' # 使用新文件名替换swagger.bat中的Name-For-Replace $filesjson | ForEach-Object { (Get-Content 'swagger.bat') -replace 'Name-For-Replace', $_ | Set-Content 'swagger.bat' } +#