Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build error for packages requiring @ai16z/eliza #331

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,43 @@ if [ ! -d "packages" ]; then
exit 1
fi

# Iterate over each directory in the packages directory
# Define the core package path
CORE_PACKAGE="packages/core"
EXCLUDED_PACKAGE="packages/agent"

# Build the core package first
if [ -d "$CORE_PACKAGE" ]; then
echo -e "\033[1mBuilding core package: core\033[0m"
cd "$CORE_PACKAGE" || exit

# Check if a package.json file exists
if [ -f "package.json" ]; then
if npm run build; then
echo -e "\033[1;32mSuccessfully built core package\033[0m\n"
else
echo -e "\033[1mFailed to build core package\033[0m"
exit 1
fi
else
echo "No package.json found in core package, skipping..."
fi

# Return to the root directory
cd - > /dev/null || exit
else
echo "Core package directory 'core' not found, skipping core build..."
fi

# Build other packages, excluding the "agent" package
for package in packages/*; do
if [ -d "$package" ]; then
echo "Building package: $(basename "$package")"
if [ "$package" != "$CORE_PACKAGE" ] && [ "$package" != "$EXCLUDED_PACKAGE" ] && [ -d "$package" ]; then
echo -e "\033[1mBuilding package: $(basename "$package")\033[0m"
cd "$package" || continue

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

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

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