#!/bin/sh -e

STEAM_INSTALL_DIR="$HOME/Library/Application Support/Steam/steamapps/common/Starbound"
# remove old version files
rm $STEAM_INSTALL_DIR/mods/Starbecue-v*.pak
rm $STEAM_INSTALL_DIR/mods/starboundSpeciesAnimOverrides-v*.pak
rm $STEAM_INSTALL_DIR/mods/Starbecue_v*.pak
rm $STEAM_INSTALL_DIR/mods/starboundSpeciesAnimOverrides_v*.pak
# add new files
cp starbound "$STEAM_INSTALL_DIR/osx/Starbound.app/Contents/MacOS/"
cp starbecue.pak "$STEAM_INSTALL_DIR/mods/"
cp SBQ_engine_assets.pak "$STEAM_INSTALL_DIR/mods/"
chmod +x "$STEAM_INSTALL_DIR/osx/Starbound.app/Contents/MacOS/starbound"
