Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

build: make build.sh independent of $PWD #32

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 18 additions & 9 deletions bin/build.sh
Expand Up @@ -2,21 +2,30 @@


# Script to generate an optimized client build of BrowserQuest # Script to generate an optimized client build of BrowserQuest


BUILDDIR="../client-build" TOPLEVELDIR="`dirname $0`/.."
PROJECTDIR="../client/js" BUILDDIR="$TOPLEVELDIR/client-build"
CURDIR=$(pwd) PROJECTDIR="$TOPLEVELDIR/client/js"




echo "Deleting previous build directory" echo "Deleting previous build directory"
rm -rf $BUILDDIR rm -rf $BUILDDIR


echo "Building client with RequireJS" echo "Building client with RequireJS"
cd $PROJECTDIR node $TOPLEVELDIR/bin/r.js -o $PROJECTDIR/build.js
node ../../bin/r.js -o build.js
cd $CURDIR


echo "Removing unnecessary js files from the build directory" echo "Removing unnecessary js files from the build directory"
find $BUILDDIR/js -type f -not \( -name "game.js" -o -name "home.js" -o -name "log.js" -o -name "require-jquery.js" -o -name "modernizr.js" -o -name "css3-mediaqueries.js" -o -name "mapworker.js" -o -name "detect.js" -o -name "underscore.min.js" -o -name "text.js" \) -delete find $BUILDDIR/js -type f \
-not \( -name "game.js" \
-o -name "home.js" \
-o -name "log.js" \
-o -name "require-jquery.js" \
-o -name "modernizr.js" \
-o -name "css3-mediaqueries.js" \
-o -name "mapworker.js" \
-o -name "detect.js" \
-o -name "underscore.min.js" \
-o -name "text.js" \) \
-delete


echo "Removing sprites directory" echo "Removing sprites directory"
rm -rf $BUILDDIR/sprites rm -rf $BUILDDIR/sprites
Expand All @@ -25,6 +34,6 @@ echo "Removing config directory"
rm -rf $BUILDDIR/config rm -rf $BUILDDIR/config


echo "Moving build.txt to current dir" echo "Moving build.txt to current dir"
mv $BUILDDIR/build.txt $CURDIR mv $BUILDDIR/build.txt $TOPLEVELDIR


echo "Build complete" echo "Build complete"