#!/bin/sh
luacbin=$1
src=$2
dst=$3
if [ "$src" = "" -o "$dst" = "" ]
then
  echo "Usage:  recursive-luac <luac-binary> <source-dir> <destination-dir>"
  exit 1
fi
cp -RL "$src" "$dst"
# TODO: handle whitespace in directory or file names correctly
for file in `find "$dst" -name '*.lua'`
do
  $1 -s -o "$file" "$file"
done
