From 520d37f438d7e13e7b452d34b23fef68550a036b Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 23 Jan 2026 03:57:09 +0800 Subject: Add core library existence and git status checks to deploy scripts --- deploy.ps1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'deploy.ps1') diff --git a/deploy.ps1 b/deploy.ps1 index c76e7ed..934c27b 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -5,6 +5,13 @@ $scriptPath = $MyInvocation.MyCommand.Path $scriptDir = Split-Path $scriptPath -Parent Set-Location $scriptDir +# Check if core library exists +$coreLibPath = "..\VersionControl\" +if (-not (Test-Path $coreLibPath)) { + Write-Warning "Core library not found at $coreLibPath. Aborting build." + exit 1 +} + # Test core library cargo test --manifest-path ..\VersionControl\Cargo.toml --workspace if ($LASTEXITCODE -ne 0) { @@ -19,13 +26,22 @@ if ($LASTEXITCODE -ne 0) { exit 1 } -# Check if git worktree is clean +# Check if main git worktree is clean $gitStatus = git status --porcelain if ($gitStatus) { Write-Warning "Git worktree is not clean. Commit or stash changes before building." exit 1 } +# Check if core library git worktree is clean +Push-Location $coreLibPath +$coreGitStatus = git status --porcelain +Pop-Location +if ($coreGitStatus) { + Write-Warning "Core library git worktree is not clean. Commit or stash changes before building." + exit 1 +} + # Check for ISCC $isccPath = Get-Command ISCC -ErrorAction SilentlyContinue if (-not $isccPath) { -- cgit