diff --git a/build/build.sh b/build/build.sh index d151c567..bc29c1a4 100755 --- a/build/build.sh +++ b/build/build.sh @@ -30,5 +30,5 @@ then mkdir ../dist/ fi -./preprocess.sh $MODE ../src/paper.js '{ "browser": true, "parser": "acorn" }' ../src/constants.js ../dist/paper.js -#./preprocess.sh $MODE ../src/paper.js '{ "server": true }' ../src/constants.js ../dist/paper-server.js +./preprocess.sh $MODE ../src/paper.js "-d '{ \"browser\": true }' -i '../src/constants.js'" ../dist/paper.js +#./preprocess.sh $MODE ../src/paper.js "-d '{ \"server\": true }' -i '../src/constants.js'" ../dist/paper-server.js diff --git a/build/docs.sh b/build/docs.sh index 686122c3..ac3148a6 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -30,5 +30,5 @@ cd .. if [ $MODE = "docs" ] then # Build paper.js library for documentation - ./preprocess.sh stripped ../src/paper.js '{ "browser": true, "parser": "acorn" }' ../src/constants.js ../dist/docs/resources/js/paper.js + ./preprocess.sh stripped ../src/paper.js "-d '{ \"browser\": true }' -i '../src/constants.js'" ../dist/docs/resources/js/paper.js fi diff --git a/build/preprocess.sh b/build/preprocess.sh index 201fec93..9553729a 100755 --- a/build/preprocess.sh +++ b/build/preprocess.sh @@ -18,7 +18,7 @@ # are preserved or stripped and whitespaces are compressed. # # Usage: -# preprocess.sh MODE SOURCE DEFINITIONS PREPRO_INCLUDE DESTINATION +# preprocess.sh MODE SOURCE ARGUMENTS DESTINATION # # MODE: # commented Preprocessed, still formated and commented @@ -27,13 +27,13 @@ VERSION=0.3 DATE=$(git log -1 --pretty=format:%ad) -COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\" }' -d '$3' -i '$4' $2" +COMMAND="./prepro.js -d '{ \"version\": $VERSION, \"date\": \"$DATE\", \"parser\": \"acorn\", \"svg\": true }' $3 $2" case $1 in commented) - eval $COMMAND > $5 + eval $COMMAND > $4 ;; stripped) - eval "$COMMAND -c" > $5 + eval "$COMMAND -c" > $4 ;; esac