Jump to content

kylerumble

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by kylerumble

  1. Thanks a lot for the great information. What I'm not understanding though is how to save a config file inside a WorkFlow that can be distributed. The data location seems to be in a totally different location than the WorkFlow.

     

    Take this Workflow for example. https://github.com/gharlan/alfred-github-workflow it has multiple files inside the Workflow folder. This is where I'd want to store the config file and access it, where the other files are.

     

    But there is the files download, and then there is the workflow download. So somehow all the files are compiled into a workflow?

     

    I'm having trouble finding this information in the Alfred docs.

  2. So I started using Alfred a few weeks ago, and just realized how awesome it is, so I decided to put together a WordPress Workflow.
     
    I'd like to share it, but I'd also like some feedback on cleaning it up (if needed), and how to create a config file for default settings such as WordPress user, password, email, so that I can keep sensitive data separate from the actual script.
     
    I'm running AMPPS for testing, and it all works. I borrowed code from a few different places.

     

    Thanks.

    # MAMP fix path
    #export PATH=/Applications/MAMP/bin/php/php5.6.1/bin:$PATH
    #export PATH=$PATH:/usr/local/bin:/Applications/MAMP/Library/bin
     
    # AMPPS fix path
    export PATH=/Applications/AMPPS/php-5.6/bin:$PATH
    export PATH=$PATH:/Applications/AMPPS/mysql/bin
     
    query="{query}"
     
     
    # MYSQL Credentials
    mysqluser="user"
    mysqlpassword="123456"
     
    # Database Credentials
    dbhost="localhost"
    dbname=$query
    dbuser=$query
    dbpass=$(openssl rand -base64 16)
     
    #WordPress Config
     
    admin_user="admin"
    admin_password="abc123"
    admin_email="name@example.com"
     
     
     
    # Create directory for new site
    cd /Applications/AMPPS/www
    mkdir $query
    cd $query
     
     
    # Create Database
    /Applications/AMPPS/mysql/bin/mysql -u $mysqluser -p$mysqlpassword -e "CREATE DATABASE $dbname;"
     
    /Applications/AMPPS/mysql/bin/mysql -u $mysqluser -p$mysqlpassword -e "GRANT ALL PRIVILEGES ON $dbname.* TO $dbuser@localhost IDENTIFIED BY '$dbpass';"
     
    /Applications/AMPPS/mysql/bin/mysql -u $dbuser -p$dbpass -e "use $dbname;"
     
    /Applications/AMPPS/mysql/bin/mysql -u $mysqluser -p$mysqlpassword -e "CREATE USER '$dbuser' IDENTIFIED BY '$dbpass';"
     
     
    # Download latest version of WordPress
    /usr/local/bin/wp core download
     
     
    # Setup wp-config file with WP_DEBUG enabled
    /usr/local/bin/wp core config --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass
     
     
    # Install WordPress
    /usr/local/bin/wp core install --url="http://www.vanwp.ca/{query}" --title="{query}" --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email
     
    
    
×
×
  • Create New...