#!/bin/sh
#
# Script to build interaction from parts
#
# Define paths
buildpath="./build"
srcpath="./src"
# Define target file
target="chain.js"
# Define license file
license="license.txt"
# Define sources
sources=( core.js update.js chain.js items.js item.js )
# Write watermark
echo "creating $buildpath/$target..."
echo "/* This file is automatically generated */" > "$buildpath/$target"
# Write license
nl="\\n"
echo "writing license..."
echo "\n/*\n\n`cat $license` \n\n*/" >> "$buildpath/$target"
# Do loop for each of sources
for source in ${sources[@]}
do
echo "writing $srcpath/$source..."
echo "\n/* $source */" >> "$buildpath/$target"
cat "$srcpath/$source" >> "$buildpath/$target"
echo "\n" >> "$buildpath/$target"
done
echo "done."
exit 0