Last active
April 6, 2018 20:39
-
-
Save BrandonDyer64/d8d4f8e3a2ee0fa157fda2acca960798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
create_script_version="1.2.0" | |
# Version | |
if [ "$1" == "--version" ] | |
then | |
echo "$create_script_version" | |
exit 0 | |
fi | |
a="${1/_config.php/}_config.php" | |
if [ -e "$a" ] | |
then | |
if [ "$2" == "--override" ] | |
then | |
echo "Overriding" | |
cp $a ${a}_backup.php | |
rm $a | |
else | |
echo "Config file already exists!" | |
echo "To override run:" | |
echo "./create $1 --override" | |
exit 1 | |
fi | |
fi | |
echo "Finding $a" | |
if [ -e "../../shelfgenie/table_config_files/${a}" ] | |
then | |
cp ../../shelfgenie/table_config_files/$a ./$a | |
from="shelfgenie" | |
elif [ -e "../../freedomsuite/table_config_files/${a}" ] | |
then | |
cp ../../freedomsuite/table_config_files/$a ./$a | |
from="freedomsuite" | |
elif [ -e "../../blankpage/table_config_files/${a}" ] | |
then | |
cp ../../blankpage/table_config_files/$a ./$a | |
from="blankpage" | |
elif [ -e "../../outbackvac/table_config_files/${a}" ] | |
then | |
cp ../../outbackvac/table_config_files/$a ./$a | |
from="outbackvac" | |
elif [ -e "../../ssfwm/table_config_files/${a}" ] | |
then | |
cp ../../ssfwm/table_config_files/$a ./$a | |
from="ssfwm" | |
else | |
wget -q -O $a https://gist.githubusercontent.com/BrandonDyer64/c8eb2e3d3f03c1b442f6eadfabf8f908/raw/wm_sample_config.php | |
from="GitHub" | |
fi | |
if [ -n "$from" ] | |
then | |
echo "Copied from $from" | |
if [ "$from" == "GitHub" ] | |
then | |
echo "Can't auto build from $from" | |
else | |
./build $1 | |
fi | |
else | |
echo "FAIL" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment