#!/bin/bash set -e if [[ "$#" -ne 2 ]]; then echo 'Turn an OpenRCT2 cmake install into a portable tar.gz.' echo '' echo 'Usage: create-portable-build ' exit 1 fi output=$1 install=$2 echo -e "\033[0;36mCreating $output..." workdir=$output-temp if [[ -d "$workdir" ]] then rm -rf $workdir fi mkdir -p $workdir/OpenRCT2 cp -r $install/bin/* $workdir/OpenRCT2 cp -r $install/share/doc $workdir/OpenRCT2 cp -r $install/share/openrct2 $workdir/OpenRCT2/data pushd $workdir > /dev/null tar -czf output.tar.gz OpenRCT2 popd > /dev/null mv $workdir/output.tar.gz $output rm -rf $workdir echo -e "\033[0;32m$output created successfully"