#!/bin/sh
#
# Checkout and install current development versions of various musical
# modules. Requires git, perl, and cpanm (ideally with local::lib):
#
# https://metacpan.org/module/cpanm
# https://metacpan.org/module/local::lib
#
# Probably should be run in a parent directory of whereever this
# repository is checked out to, for example:
#
#   $ sh App-MusicTools/install-music-modules

while read repo; do
  git clone $repo
done <<'EOR'
https://github.com/thrig/Music-Chord-Positions.git
https://github.com/thrig/Music-LilyPondUtil.git
https://github.com/thrig/Music-Tension.git
https://github.com/thrig/Music-AtonalUtil.git
https://github.com/thrig/Music-Canon.git
https://github.com/thrig/App-MusicTools.git
EOR

while read dir; do
  # NOTE must close stdin to cpanm as otherwise cpanm inherits and reads
  # the remaining dirs, and then while loop has nothing left to do.
  ( cd $dir && git pull && cpanm . < /dev/null )
done <<'EOD'
Music-Chord-Positions
Music-LilyPondUtil
Music-Tension
Music-AtonalUtil
Music-Canon
App-MusicTools
EOD
