This repository was archived by the owner on Apr 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrestore-libs.sh
More file actions
executable file
·89 lines (75 loc) · 2.63 KB
/
restore-libs.sh
File metadata and controls
executable file
·89 lines (75 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
echo "======================================"
echo "🔧 Aevatar Framework - Restore Frontend Libraries"
echo "======================================"
echo ""
# Check if we're in the right directory
if [ ! -f "DEPLOYMENT.md" ]; then
echo "❌ Error: Please run this script from the project root directory"
exit 1
fi
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Try ABP CLI first
if command_exists abp; then
echo "✅ ABP CLI found, using abp install-libs..."
echo ""
echo "1. Restoring AuthServer libraries..."
cd src/Aevatar.BusinessServer/src/Aevatar.AuthServer
if abp install-libs; then
echo " ✅ AuthServer libraries restored"
else
echo " ⚠️ abp install-libs failed for AuthServer"
ABP_FAILED=1
fi
echo ""
echo "2. Restoring BusinessServer libraries..."
cd ../Aevatar.BusinessServer.Web
if abp install-libs; then
echo " ✅ BusinessServer libraries restored"
else
echo " ⚠️ abp install-libs failed for BusinessServer"
ABP_FAILED=1
fi
if [ -z "$ABP_FAILED" ]; then
echo ""
echo "======================================"
echo "✅ All frontend libraries restored!"
echo "======================================"
exit 0
fi
else
echo "⚠️ ABP CLI not found"
echo " To install: dotnet tool install -g Volo.Abp.Cli"
echo ""
fi
# If ABP CLI failed or not available, use manual method
echo "======================================"
echo "📦 Using manual restoration method..."
echo "======================================"
echo ""
cd "$(dirname "$0")/src/Aevatar.BusinessServer"
# Check if BusinessServer already has libs
if [ -d "src/Aevatar.BusinessServer.Web/wwwroot/libs" ] && [ "$(ls -A src/Aevatar.BusinessServer.Web/wwwroot/libs 2>/dev/null)" ]; then
echo "✅ BusinessServer libraries already exist"
echo ""
echo "Copying to AuthServer..."
mkdir -p src/Aevatar.AuthServer/wwwroot/libs
cp -r src/Aevatar.BusinessServer.Web/wwwroot/libs/* src/Aevatar.AuthServer/wwwroot/libs/
echo ""
echo "======================================"
echo "✅ Frontend libraries restored!"
echo "======================================"
exit 0
fi
# If no existing libs, need to install from npm
echo "⚠️ No existing libraries found"
echo " You need to either:"
echo " 1. Install ABP CLI: dotnet tool install -g Volo.Abp.Cli"
echo " 2. Get libs archive from team lead"
echo " 3. Manually copy from another deployment"
echo ""
echo "❌ Manual restoration failed"
exit 1