1# pgn4web javascript chessboard 2# copyright (C) 2009-2016 Paolo Casaschi 3# see README file and http://pgn4web.casaschi.net 4# for credits, license and more details 5 6# bash script to create a custom pgn4web package 7# run as "bash script.sh" 8 9set +o posix 10 11pgn4webBaseFiles="README.txt pgn4web.js pgn4web-help.html license-gpl-2.0.txt pawn.ico pawn.png pawns.png index.html" 12 13case "$1" in 14 15 "board-minimal" ) pgn4webPackageFileList="$pgn4webBaseFiles board.html fide-lookup.js pgn-decoder.js images/index.html images/uscf/index.html images/uscf/README.txt images/uscf/20/* fonts/index.html fonts/README.txt fonts/chess-informant-NAG-symbols.js fonts/LiberationSans* fonts/pgn4web-font-LiberationSans.css fonts/ChessSansPiratf* fonts/pgn4web-font-ChessSansPiratf.css fonts/ChessInformantReader* fonts/pgn4web-font-ChessInformantReader.css";; 16 17 "library-full" ) pgn4webPackageFileList="$pgn4webBaseFiles fide-lookup.js fonts/* images/* libs/README.txt libs/index.html libs/garbochess/* engine.* live/index.html live/*.pgn pgn4web-server-config.js";; 18 19 "library-minimal" ) pgn4webPackageFileList="$pgn4webBaseFiles images/index.html images/*.png live/index.html live/*.pgn pgn4web-server-config.js";; 20 21 "live-full" ) pgn4webPackageFileList="$pgn4webBaseFiles dynamic-frame.html live-compact.* live-fullscreen.html live-mosaic* live-results.html blank.html fide-lookup.js crc32.js demoLiveGames.pgn fonts/index.html fonts/README.txt fonts/chess-informant-NAG-symbols.js fonts/LiberationSans* fonts/pgn4web-font-LiberationSans.css fonts/ChessSansPiratf* fonts/pgn4web-font-ChessSansPiratf.css fonts/ChessInformantReader* fonts/pgn4web-font-ChessInformantReader.css images/index.html images/alpha/index.html images/alpha/README.txt images/alpha/24/* images/alpha/26/* images/alpha/32/* images/alpha/96/* images/merida/index.html images/merida/README.txt images/merida/96/* images/uscf/index.html images/uscf/README.txt images/uscf/96/* libs/README.txt libs/index.html libs/garbochess/* engine.* live/*";; 22 23 "live-games-app" ) pgn4webPackageFileList="$pgn4webBaseFiles dynamic-frame.html fide-lookup.js fonts/index.html fonts/chess-informant-NAG-symbols.js fonts/LiberationSans* fonts/pgn4web-font-LiberationSans.css fonts/pgn4web-font-ChessInformantReader.css fonts/ChessInformantReader.* images/index.html images/alpha/index.html images/alpha/96/* libs/README.txt libs/index.html libs/garbochess/* engine.* live-games-app*";; 24 25 "live-minimal" ) pgn4webPackageFileList="$pgn4webBaseFiles dynamic-frame.html live-compact.* live-fullscreen.html live-mosaic* live-results.html blank.html fide-lookup.js crc32.js demoLiveGames.pgn images/index.html images/alpha/index.html images/alpha/README.txt images/alpha/24/* images/alpha/26/* images/alpha/32/* images/alpha/96/* images/merida/index.html images/merida/README.txt images/merida/96/* images/uscf/index.html images/uscf/README.txt images/uscf/96/* fonts/index.html fonts/README.txt fonts/chess-informant-NAG-symbols.js fonts/LiberationSans* fonts/pgn4web-font-LiberationSans.css fonts/ChessSansPiratf* fonts/pgn4web-font-ChessSansPiratf.css fonts/ChessInformantReader* fonts/pgn4web-font-ChessInformantReader.css libs/README.txt libs/index.html libs/garbochess/* engine.* live/index.html live/live-simulation.sh live/*.pgn";; 26 27 * ) echo "bash `basename $0` [board-minimal | library-full | library-minimal | live-minimal]"; exit 0 ;; 28 29esac 30 31pgn4webVer=$(grep "var pgn4web_version = " pgn4web.js | awk -F "'" '{print$2}') 32 33pgn4webPackageFilename="pgn4web-$pgn4webVer-$1.zip" 34 35if [ -e "$pgn4webPackageFilename" ]; then 36 echo "Error: pgn4web package already exists ($pgn4webPackageFilename)" 37 exit 1 38fi 39 40zip -9r "$pgn4webPackageFilename" $pgn4webPackageFileList -x *.svn/* 41 42echo 43if [ $? -eq 0 ]; 44then 45 echo "Package $pgn4webPackageFilename ready" 46else 47 echo "Error creating package $pgn4webPackageFilename" 48fi 49 50