[fixed] comporess achieve repetition

This commit is contained in:
Zhanpeng Yang 2024-09-25 20:50:54 +08:00
parent 6f9dd0224c
commit 44239a87eb

View File

@ -41,8 +41,8 @@ If($cmd -eq "release"){
If (Test-Path ".next/static"){
#复制static文件夹
Copy-Item -Path .next/static -Destination .next/standalone/.next -Recurse -Force
#把.next/standalone文件夹下的所有文件与.next打包。之所以不用通配符.next/standalone/*是因为这个目录下还有node_modules是软连接,会报错。
Compress-Archive -Path .next/standalone/*.*,.next/standalone/.next -DestinationPath "./build/SEMS-on-device-server-$version.zip" -Force
#把.next/standalone文件夹下的所有文件打包但是除了这个目录下的node_modules文件因为他是Linux系统下的软连接,会报错。
Get-ChildItem -Path ".next/standalone/" -Recurse | Where-Object { $_.Name -ne "node_modules" } | Compress-Archive -DestinationPath "./build/SEMS-on-device-server-$version.zip" -Force
Write-Host "Released /build/SEMS-on-device-server-$version.zip"