lila/bin/gen/piece-update

31 lines
618 B
Bash
Executable File

#!/bin/bash -e
file=$1
single_name=$2
build_dir=$(mktemp -d /tmp/lila-piece-XXXXXX)
commit_msg=""
unzip $file -d $build_dir
if [[ ! -z "$single_name" ]]; then
echo "Building $single_name in $build_dir"
cp -v $build_dir/* public/piece/$single_name/
commit_msg="Update $single_name pieces"
else
echo "Building multiple pieces in $build_dir"
cp -rv $build_dir/* public/piece/
commit_msg="Update several piece sets"
fi
bin/gen/piece-sprite
git add public/piece
git add public/piece-css
git commit -m "$commit_msg"
git log --name-status HEAD^..HEAD
read -n 1 -p "Press [Enter] to push"
git push
rm $file