Files
SoonDesign/scripts/write-web-version.ps1
T
24kycj ce76bb8018 fix(web): 修复 .soon/模板加载、旧文件兼容与另存为离开提示
- 删除 design1 ui 遗留代码,修复加载竞态与新建不弹保存提示
- cloud-files 归一化旧版 .soon,IndexedDB 写入完成后再跳转设计页
- 模板/本地 .soon 首次保存须另存为,离开前统一确认
- 发版缓存 bust(version.js、soon-cache.js)及宝塔 Nginx 配置文档

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 00:30:20 +08:00

22 lines
684 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 写入 frontend-web/config/version.jsstart.bat / sync-config 自动调用,发版上传前也会更新)
param([string]$Version = '')
$ErrorActionPreference = 'Stop'
$Root = Split-Path $PSScriptRoot -Parent
$WebRoot = Join-Path $Root 'frontend-web'
if (-not $Version) {
Push-Location $Root
try { $Version = (git rev-parse --short HEAD 2>$null) } finally { Pop-Location }
if (-not $Version) { $Version = Get-Date -Format 'yyyyMMddHHmmss' }
}
$out = @"
(function () {
'use strict';
window.SOON_APP_VERSION = '$Version';
})();
"@
$path = Join-Path $WebRoot 'config\version.js'
[System.IO.File]::WriteAllText($path, $out, (New-Object System.Text.UTF8Encoding $false))