1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/bash
if [[ ! -f /root/performous/platform_flags.sh ]]; then
mkdir -p /root/performous
cp -v ./platform_flags.sh /root/performous/
fi
function export_platform_flags () {
if [[ $# > 1 ]]; then
echo "WARNING: export_platform_flags takes only 1 argument, the rest are ignored."
elif [[ $# < 1 ]]; then
echo "ERROR: export_platform_flags needs an argument."
exit 1
fi
echo "export PLATFORM_CMAKE_FLAGS='"${1}"'" | tee -a /root/performous/PLATFORM_CMAKE_FLAGS
}
function import_platform_flags () {
if [ $# -gt 0 ]; then
echo "WARNING: import_platform_flags does not take arguments, we'll just ignore them."
elif [ ! -d /root/performous ]; then
echo "ERROR: /root/performous doesn't exist, so there can't be any flags to import. Use `export_platform_flags` first."
exit 1
fi
test -f /root/performous/PLATFORM_CMAKE_FLAGS && . /root/performous/PLATFORM_CMAKE_FLAGS
}
|