Make build.sh drop output in correct dirs

This commit is contained in:
Andrew Miner
2017-06-04 20:38:27 -07:00
parent bcbb951c6f
commit 6b25d4ecfa
+7 -6
View File
@@ -23,7 +23,7 @@ function check-dependencies {
echo echo
exit 1 exit 1
fi fi
if [[ ! -d "$LILYPOND_APP" ]]; then if [[ ! -d "$LILYPOND_APP" ]]; then
echo "Could not find LilyPond! Please install it from http://lilypond.org/download.html." echo "Could not find LilyPond! Please install it from http://lilypond.org/download.html."
echo echo
@@ -34,10 +34,10 @@ function check-dependencies {
function compile-ly { function compile-ly {
BASE_NAME=$(basename -s .ly $1) BASE_NAME=$(basename -s .ly $1)
DIR_NAME=$(dirname $1 | sed "s@./src/scores/@@") DIR_NAME=$(dirname $1 | sed "s@./src/scores/@@")
mkdir -p "dist/$DIR_NAME" mkdir -p "dist/$DIR_NAME"
$LILYPOND -I "$PWD/src/includes" -I "$PWD/src/pieces" -o "dist/$DIR_NAME/$BASE_NAME" $1 $LILYPOND -I "$PWD/src/includes" -I "$PWD/src/pieces" -o "dist/$DIR_NAME/$BASE_NAME" $1
if [[ "$VIEW" == "YES" ]]; then if [[ "$VIEW" == "YES" ]]; then
open -a "/Applications/Google Chrome.app" -g "dist/$DIR_NAME/$BASE_NAME.pdf" open -a "/Applications/Google Chrome.app" -g "dist/$DIR_NAME/$BASE_NAME.pdf"
fi fi
@@ -56,12 +56,12 @@ function command-clean {
function command-compile { function command-compile {
[[ ${#PATTERNS[*]} == 0 ]] && PATTERNS=(".*") [[ ${#PATTERNS[*]} == 0 ]] && PATTERNS=(".*")
while true; do while true; do
PATTERN=${PATTERNS[0]} PATTERN=${PATTERNS[0]}
[[ "$PATTERN" == "" ]] && break [[ "$PATTERN" == "" ]] && break
PATTERNS=(${PATTERNS[@]:1}) PATTERNS=(${PATTERNS[@]:1})
find src/scores -name "*.ly" | grep -v includes | grep "$PATTERN" | while read FILE; do find src/scores -name "*.ly" | grep -v includes | grep "$PATTERN" | while read FILE; do
compile-ly "./$FILE" compile-ly "./$FILE"
done done
@@ -69,8 +69,9 @@ function command-compile {
} }
function command-watch { function command-watch {
CURRENT_DIR=$(dirname $0)
$FSWATCH -r src/scores -i '*.ly$' -e "includes" | while read FILE; do $FSWATCH -r src/scores -i '*.ly$' -e "includes" | while read FILE; do
FILE=$(echo $FILE | sed "s@$PWD@.@") FILE=$(echo $FILE | sed 's@.*/src/scores/\(.*\)$@./src/scores/\1@')
compile-ly $FILE compile-ly $FILE
done done
} }