# automatically builds the latest versions of the CreateJS suite
# and puts them into vendor/scripts.

# for this to work:
# 1. create the CreateJS directory in your Desktop
# 2. git clone all four suites into that directory (ex. https://github.com/CreateJS/PreloadJS.git)
# 3. npm install grunt-cli for each, or add the -g options to run globally once

# then you can run this script to build the latest version whenever
# see the build/README file in any of these libraries on GitHub for more info
# https://github.com/CreateJS/EaselJS/blob/master/build/README.md

cd ~/Desktop/CreateJS/EaselJS/
echo updating Easel
git checkout .
git pull
sudo npm update
cd build
sudo npm update
echo building Easel
grunt combine

cd ~/Desktop/CreateJS/PreloadJS/
echo updating Preload
git checkout .
git pull
sudo npm update
cd build
sudo npm install
sudo npm update
echo building Preload
grunt combine

cd ~/Desktop/CreateJS/SoundJS/
echo updating Sound
git checkout .
git pull
sudo npm update
cd build
sudo npm install
sudo npm update
echo building Sound
grunt combine

cd ~/Desktop/CreateJS/TweenJS/
echo updating Tween
git checkout .
git pull
sudo npm update
cd build
sudo npm install
sudo npm update
echo building Tween
grunt combine

echo moving to CoCo
cp ~/Desktop/CreateJS/EaselJS/build/output/easeljs-NEXT.combined.js ~/Desktop/coco/vendor/scripts
cp ~/Desktop/CreateJS/EaselJS/build/output/movieclip-NEXT.min.js ~/Desktop/coco/vendor/scripts
cp ~/Desktop/CreateJS/EaselJS/src/easeljs/display/SpriteStage.js ~/Desktop/coco/vendor/scripts/
cp ~/Desktop/CreateJS/EaselJS/src/easeljs/display/SpriteContainer.js ~/Desktop/coco/vendor/scripts/
cp ~/Desktop/CreateJS/SoundJS/build/output/soundjs-NEXT.combined.js ~/Desktop/coco/vendor/scripts
cp ~/Desktop/CreateJS/PreloadJS/build/output/preloadjs-NEXT.combined.js ~/Desktop/coco/vendor/scripts
cp ~/Desktop/CreateJS/TweenJS/build/output/tweenjs-NEXT.combined.js ~/Desktop/coco/vendor/scripts