zip time for build
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"build": "pnpm run type-check:publish && vite build",
|
||||
"build:zip": "pnpm run build && powershell -NoProfile -Command \"New-Item -ItemType Directory -Force -Path release | Out-Null; Compress-Archive -Path dist\\* -DestinationPath release\\gao-customer-h5.zip -Force\"",
|
||||
"build:zip": "pnpm run build && powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build-zip.ps1",
|
||||
"twa:build": "cd twa && pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 build --manifest=./twa-manifest.json",
|
||||
"twa:update": "cd twa && pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 update --skipVersionUpgrade --manifest=./twa-manifest.json",
|
||||
"twa:validate": "pnpm --config.registry=https://registry.npmjs.org dlx @bubblewrap/cli@1.25.0 validate --url=https://gao.imyeyu.com/",
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$projectRoot = Split-Path -Parent $PSScriptRoot
|
||||
$releaseDirectory = Join-Path $projectRoot "release"
|
||||
$distPath = Join-Path $projectRoot "dist"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $releaseDirectory | Out-Null
|
||||
|
||||
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
||||
$archiveBaseName = "gao-customer-h5-$timestamp"
|
||||
$archivePath = Join-Path $releaseDirectory "$archiveBaseName.zip"
|
||||
$collisionIndex = 1
|
||||
|
||||
while (Test-Path -LiteralPath $archivePath) {
|
||||
$archivePath = Join-Path $releaseDirectory "$archiveBaseName-$collisionIndex.zip"
|
||||
$collisionIndex++
|
||||
}
|
||||
|
||||
Compress-Archive -Path (Join-Path $distPath "*") -DestinationPath $archivePath -ErrorAction Stop
|
||||
Write-Output "Created archive: $archivePath"
|
||||
Reference in New Issue
Block a user