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.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh index de598b7..7420c2b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -5,6 +5,13 @@ # Change to the directory where the script is located cd "$(dirname "$0")" || exit 1 +# Check if core library exists +coreLibPath="../VersionControl/" +if [ ! -d "$coreLibPath" ]; then + echo "Core library not found at $coreLibPath. Aborting build." + exit 1 +fi + # Test core library cargo test --manifest-path ../VersionControl/Cargo.toml --workspace if [ $? -ne 0 ]; then @@ -19,13 +26,22 @@ if [ $? -ne 0 ]; then exit 1 fi -# Check if git worktree is clean +# Check if main git worktree is clean git_status=$(git status --porcelain) if [ -n "$git_status" ]; then echo "Git worktree is not clean. Commit or stash changes before building." exit 1 fi +# Check if core library git worktree is clean +pushd "$coreLibPath" > /dev/null +core_git_status=$(git status --porcelain) +popd > /dev/null +if [ -n "$core_git_status" ]; then + echo "Core library git worktree is not clean. Commit or stash changes before building." + exit 1 +fi + # Build if FORCE_BUILD=$(date +%s) cargo build --workspace --release; then # Export -- cgit