Skip to content

Commit b6cdbdf

Browse files
authoredNov 15, 2024
Merge pull request #331 from shakkernerd/main
fix: Build error for packages requiring @ai16z/eliza
2 parents abfec48 + 583aad9 commit b6cdbdf

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed
 

‎scripts/build.sh

+34-6
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,43 @@ if [ ! -d "packages" ]; then
1818
exit 1
1919
fi
2020

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
2249
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"
2552
cd "$package" || continue
2653

2754
# Check if a package.json file exists
2855
if [ -f "package.json" ]; then
29-
# Run the build script defined in package.json
3056
if npm run build; then
31-
echo "Successfully built $(basename "$package")"
57+
echo -e "\033[1;32mSuccessfully built $(basename "$package")\033[0m\n"
3258
else
3359
echo "Failed to build $(basename "$package")"
3460
fi
@@ -38,7 +64,9 @@ for package in packages/*; do
3864

3965
# Return to the root directory
4066
cd - > /dev/null || exit
67+
elif [ "$package" == "$EXCLUDED_PACKAGE" ]; then
68+
echo -e "\033[1mSkipping package: agent\033[0m\n"
4169
fi
4270
done
4371

44-
echo "Build process completed."
72+
echo -e "\033[1mBuild process completed.😎\033[0m"

0 commit comments

Comments
 (0)