linepress / wp-tools

WordPress tools
2 stars 3 forks source link

Some ideas #7

Open sebastiaandegeus opened 11 years ago

sebastiaandegeus commented 11 years ago

Let users setup their local environment settings first time using the wp-tools so future site install are faster.

If you could do this you would install a new wordpress website in less than 3 minutes without messing around with vhosts, /etc/hosts and creating databases by hand.

jmslbam commented 11 years ago

With a .yml file

jmslbam commented 11 years ago

Some weeks ago I have experimented with this bash script http://stackoverflow.com/questions/5983558/reading-a-config-file-from-a-shell-script

Does make it independent...

yaml.sh

CONFIGFILE="cnf.yaml"
echo "=$DB_USER= =$DB_PASS= =$MYSQL_PATH=" #these variables are not defined here
eval `sed '/^ *#/d;s/:/ /;' < "$CONFIGFILE" | while read key val
do
    #verify here
    #...
    str="$key='$val'"
    echo "$str"
done`
echo =$DB_USER= =$DB_PASS= =$MYSQL_PATH= #here are defined

cnf.yaml

DB_USER: root
DB_PASS: root
MYSQL_PATH: foo