From 44cd3d4ad8a38fe1c2063f75dcd2b12bb0147fe9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrg=20Lehni?= <juerg@scratchdisk.com>
Date: Wed, 26 Jun 2013 19:22:38 -0700
Subject: [PATCH] Change names of built library to paper-full.js, and have
 dist/paper.js link to it after build.sh was run.

---
 build/build.sh  | 9 ++++++++-
 build/load.sh   | 5 ++++-
 build/minify.sh | 4 ++--
 dist/.gitignore | 2 --
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/build/build.sh b/build/build.sh
index c1175b2c..98a8bce1 100755
--- a/build/build.sh
+++ b/build/build.sh
@@ -30,6 +30,13 @@ then
 	mkdir ../dist/
 fi
 
-./preprocess.sh $MODE ../src/paper.js "-o '{ \"browser\": true }' -i '../src/constants.js'" ../dist/paper.js
+./preprocess.sh $MODE ../src/paper.js "-o '{ \"browser\": true }' -i '../src/constants.js'" ../dist/paper-full.js
 ./preprocess.sh $MODE ../src/paper.js "-o '{ \"browser\": true, \"paperscript\": false }' -i '../src/constants.js'" ../dist/paper-core.js
 #./preprocess.sh $MODE ../src/paper.js "-o '{ \"node\": true }' -i '../src/constants.js'" ../dist/paper-node.js 
+
+# Remove the symbolic link and create a new one to the built library now
+if [ -f ../dist/paper.js ]
+then
+	rm ../dist/paper.js
+fi
+ln -s paper-full.js ../dist/paper.js
diff --git a/build/load.sh b/build/load.sh
index 8462ad5b..b2cec51f 100755
--- a/build/load.sh
+++ b/build/load.sh
@@ -13,5 +13,8 @@
 # This script simply generates a symbolic link from dist/paper.js to src/load.js
 # which loads the library from separate sources through PrePro.
 
-rm ../dist/paper.js
+if [ -f ../dist/paper.js ]
+then
+	rm ../dist/paper.js
+fi
 ln -s ../src/load.js ../dist/paper.js
diff --git a/build/minify.sh b/build/minify.sh
index cdabef51..658fc982 100755
--- a/build/minify.sh
+++ b/build/minify.sh
@@ -10,5 +10,5 @@
 #
 # All rights reserved.
 
-../node_modules/.bin/uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unsafe=true -m -b ascii_only=true,beautify=false --comments /^!/
-../node_modules/.bin/uglifyjs ../dist/paper-core.js -o ../dist/paper-core-min.js -c unsafe=true -m --comments /^!/
+../node_modules/.bin/uglifyjs ../dist/paper-full.js -o ../dist/paper-full.min.js -c unsafe=true -m -b ascii_only=true,beautify=false --comments /^!/
+../node_modules/.bin/uglifyjs ../dist/paper-core.js -o ../dist/paper-core.min.js -c unsafe=true -m --comments /^!/
diff --git a/dist/.gitignore b/dist/.gitignore
index bc509d86..8600e4f2 100644
--- a/dist/.gitignore
+++ b/dist/.gitignore
@@ -1,5 +1,3 @@
-/paper-min.js
-/paper-server.js
 /docs/
 /serverdocs/
 /paperjs.zip