@@ -18,17 +18,43 @@ if [ ! -d "packages" ]; then
18
18
exit 1
19
19
fi
20
20
21
- # Iterate over each directory in the packages directory
21
+ # Define the core package path
22
+ CORE_PACKAGE=" packages/core"
23
+ EXCLUDED_PACKAGE=" packages/agent"
24
+
25
+ # Build the core package first
26
+ if [ -d " $CORE_PACKAGE " ]; then
27
+ echo -e " \033[1mBuilding core package: core\033[0m"
28
+ cd " $CORE_PACKAGE " || exit
29
+
30
+ # Check if a package.json file exists
31
+ if [ -f " package.json" ]; then
32
+ if npm run build; then
33
+ echo -e " \033[1;32mSuccessfully built core package\033[0m\n"
34
+ else
35
+ echo -e " \033[1mFailed to build core package\033[0m"
36
+ exit 1
37
+ fi
38
+ else
39
+ echo " No package.json found in core package, skipping..."
40
+ fi
41
+
42
+ # Return to the root directory
43
+ cd - > /dev/null || exit
44
+ else
45
+ echo " Core package directory 'core' not found, skipping core build..."
46
+ fi
47
+
48
+ # Build other packages, excluding the "agent" package
22
49
for package in packages/* ; do
23
- if [ -d " $package " ]; then
24
- echo " Building package: $( basename " $package " ) "
50
+ if [ " $package " != " $CORE_PACKAGE " ] && [ " $package " != " $EXCLUDED_PACKAGE " ] && [ -d " $package " ]; then
51
+ echo -e " \033[1mBuilding package: $( basename " $package " ) \033[0m "
25
52
cd " $package " || continue
26
53
27
54
# Check if a package.json file exists
28
55
if [ -f " package.json" ]; then
29
- # Run the build script defined in package.json
30
56
if npm run build; then
31
- echo " Successfully built $( basename " $package " ) "
57
+ echo -e " \033[1;32mSuccessfully built $( basename " $package " ) \033[0m\n "
32
58
else
33
59
echo " Failed to build $( basename " $package " ) "
34
60
fi
@@ -38,7 +64,9 @@ for package in packages/*; do
38
64
39
65
# Return to the root directory
40
66
cd - > /dev/null || exit
67
+ elif [ " $package " == " $EXCLUDED_PACKAGE " ]; then
68
+ echo -e " \033[1mSkipping package: agent\033[0m\n"
41
69
fi
42
70
done
43
71
44
- echo " Build process completed."
72
+ echo -e " \033[1mBuild process completed.😎\033[0m "
0 commit comments