Skip to content

Commit

Permalink
Update build-cloudflare-pages.sh
Browse files Browse the repository at this point in the history
Enhanced some lines
  • Loading branch information
ShabibMahamood authored Nov 14, 2024
1 parent de716c4 commit d6c79b3
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions scripts/build-cloudflare-pages.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
#!/bin/bash

# Exit on any error
set -e

npm ci
npm link
npm run build
# Functions for better readability
install_dependencies() {
echo "Installing main dependencies..."
npm ci
}

link_package() {
echo "Linking package..."
if ! npm link &> /dev/null; then
echo "Failed to link package. Exiting."
exit 1
fi
}

build_package() {
echo "Building main package..."
npm run build
}

setup_demo() {
echo "Setting up demo environment..."
cd demo
npm install
npm link dynamic-marquee # Link the main package in the demo environment
npm run build
}

cd demo
npm install
npm link dynamic-marquee
npm run build
# Run the functions in sequence
install_dependencies
link_package
build_package
setup_demo

echo "Done!"

0 comments on commit d6c79b3

Please sign in to comment.