Skip to content

Instantly share code, notes, and snippets.

@jsoningram
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save jsoningram/0a6ed100ee274da33d57 to your computer and use it in GitHub Desktop.

Select an option

Save jsoningram/0a6ed100ee274da33d57 to your computer and use it in GitHub Desktop.

Revisions

  1. jsoningram revised this gist Jun 24, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions wpbase
    Original file line number Diff line number Diff line change
    @@ -72,6 +72,7 @@ echo '{"directory" : "components"}' > ~/$local/$dir/wp-content/themes/$theme/.bo
    # Create base .gitignore in theme folder
    echo '.DS_STORE
    /components
    /bower_components
    /node_modules
    /images/source
    /images/working' > ~/$local/$dir/wp-content/themes/$theme/.gitignore
    @@ -85,6 +86,9 @@ git init ~/$local/$dir/wp-content/themes/$theme/

    # Set local HTTP_HOST
    sed -i "" "s/%%INSTALL_DIR%%/${dir}/g" ~/$local/$dir/wp-config.php

    # Set default theme
    sed -i "" "s/%%DEFAULT_THEME%%/${theme}/g" ~/$local/$dir/wp-config.php

    # Set DB, DB user and pass (include "" after -i for OS X)
    sed -i "" "s/DEV_DBNAME/${theme}/g" ~/$local/$dir/wp-config.php
  2. jsoningram revised this gist Jun 23, 2015. 1 changed file with 73 additions and 67 deletions.
    140 changes: 73 additions & 67 deletions wpbase
    Original file line number Diff line number Diff line change
    @@ -1,116 +1,122 @@
    #!/bin/bash
    # Install WordPress and Zurb Foundation
    # Usage: wpbase <dirname> <themename>
    # Assumes you're in your home directory and installing into ~/DIRNAME

    # Installs into ~/$local/$dir
    dir=$1
    theme=$2

    # Define local server dir
    local="www"

    # Set table prefix
    random_number=$RANDOM
    sep='_'
    table_prefix=$theme$random_number$sep

    # Set production info
    dbpass=$(env LC_CTYPE=C tr -dc "a-zA-Z0-9&*(){}_+?><~;\!@#$%^" < /dev/urandom | head -c 15)
    dbun=$RANDOM$theme

    # Get secret keys
    curl https://api.wordpress.org/secret-key/1.1/salt/ > ~/$dir/keys.txt

    curl https://api.wordpress.org/secret-key/1.1/salt/ > ~/$local/$dir/keys.txt
    # Install latest WP
    cd ~/$dir
    cd ~/$local/$dir
    wget https://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    mv wordpress/* ~/$local/$dir
    # Install _s
    git clone https://github.com/Automattic/_s.git ~/$dir/wp-content/themes/$theme

    git clone https://github.com/Automattic/_s.git ~/$local/$dir/wp-content/themes/$theme
    # Download bower file from gist
    cd ~/$dir/wp-content/themes/$theme/
    cd ~/$local/$dir/wp-content/themes/$theme/
    git clone https://gist.github.com/19a995445b52786194e5.git
    mv ~/$dir/wp-content/themes/$theme/19a995445b52786194e5/bower.json ~/$dir/wp-content/themes/$theme/bower.json

    mv ~/$local/$dir/wp-content/themes/$theme/19a995445b52786194e5/bower.json ~/$local/$dir/wp-content/themes/$theme/bower.json
    # Download package file for gulp from gist
    cd ~/$dir/wp-content/themes/$theme/
    cd ~/$local/$dir/wp-content/themes/$theme/
    git clone https://gist.github.com/d1cf5b837a6831136599.git
    mv ~/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/package.json ~/$dir/wp-content/themes/$theme/package.json

    mv ~/$local/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/package.json ~/$local/$dir/wp-content/themes/$theme/package.json
    # Download wp-config from gist
    cd ~/$dir
    cd ~/$local/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php

    mv ~/$local/$dir/b3313c7457647cb0544c/wp-config.php ~/$local/$dir/wp-config.php
    # Download Foundation init from gist
    cd ~/$dir/wp-content/themes/$theme/js
    cd ~/$local/$dir/wp-content/themes/$theme/js
    git clone https://gist.github.com/d8958509b2dccaf5e2ff.git
    mv ~/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/foundation-init.js ~/$dir/wp-content/themes/$theme/js/foundation-init.js

    mv ~/$local/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/foundation-init.js ~/$local/$dir/wp-content/themes/$theme/js/foundation-init.js
    # Namespace theme
    cd ~/$dir/wp-content/themes/$theme
    cd ~/$local/$dir/wp-content/themes/$theme
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/'_s'/'$theme'/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/_s_/${theme}_/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/Text Domain: _s/Text Domain: $theme/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/ _s/ $theme/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/_s-/${theme}-/g"

    # Structure
    mkdir ~/$dir/wp-content/themes/$theme/fonts
    mkdir ~/$dir/wp-content/themes/$theme/css
    mkdir ~/$dir/wp-content/themes/$theme/images
    mkdir ~/$dir/wp-content/themes/$theme/images/working
    mkdir ~/$dir/wp-content/themes/$theme/images/source
    touch ~/$dir/wp-content/themes/$theme/css/googlefonts.css

    mkdir ~/$local/$dir/wp-content/themes/$theme/fonts
    mkdir ~/$local/$dir/wp-content/themes/$theme/css
    mkdir ~/$local/$dir/wp-content/themes/$theme/images
    mkdir ~/$local/$dir/wp-content/themes/$theme/images/working
    mkdir ~/$local/$dir/wp-content/themes/$theme/images/source
    touch ~/$local/$dir/wp-content/themes/$theme/css/googlefonts.css
    # Create .bowerrc in theme folder
    echo '{"directory" : "components"}' > ~/$dir/wp-content/themes/$theme/.bowerrc

    echo '{"directory" : "components"}' > ~/$local/$dir/wp-content/themes/$theme/.bowerrc
    # Create base .gitignore in theme folder
    echo '.DS_STORE
    /components
    /node_modules
    /images/source
    /images/working' > ~/$dir/wp-content/themes/$theme/.gitignore

    /images/working' > ~/$local/$dir/wp-content/themes/$theme/.gitignore
    # Install components
    cd ~/$dir/wp-content/themes/$theme/
    cd ~/$local/$dir/wp-content/themes/$theme/
    bower install

    # Create empty Git repo in the theme directory
    git init ~/$dir/wp-content/themes/$theme/

    # Set DB, DB user and pass ("" after -i for OS X)
    sed -i "" "s/DEV_DBNAME/${theme}/g" ~/$dir/wp-config.php
    sed -i "" "s/DEV_DBUSER/${theme}/g" ~/$dir/wp-config.php
    sed -i "" "s/DEV_DBPASS/${theme}/g" ~/$dir/wp-config.php

    sed -i "" "s/PRODUCTION_DBNAME/${dbun}/g" ~/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBUSER/${dbun}/g" ~/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBPASS/${dbpass}/g" ~/$dir/wp-config.php

    git init ~/$local/$dir/wp-content/themes/$theme/

    # Set local HTTP_HOST
    sed -i "" "s/%%INSTALL_DIR%%/${dir}/g" ~/$local/$dir/wp-config.php

    # Set DB, DB user and pass (include "" after -i for OS X)
    sed -i "" "s/DEV_DBNAME/${theme}/g" ~/$local/$dir/wp-config.php
    sed -i "" "s/DEV_DBUSER/${theme}/g" ~/$local/$dir/wp-config.php
    sed -i "" "s/DEV_DBPASS/${theme}/g" ~/$local/$dir/wp-config.php

    sed -i "" "s/PRODUCTION_DBNAME/${dbun}/g" ~/$local/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBUSER/${dbun}/g" ~/$local/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBPASS/${dbpass}/g" ~/$local/$dir/wp-config.php

    # Set secret keys
    cd ~/$dir
    cd ~/$local/$dir
    sed -i "" "/%%SECRET_KEYS%%/{
    s/%%SECRET_KEYS%%//g
    r keys.txt
    }" ~/$dir/wp-config.php

    }" ~/$local/$dir/wp-config.php
    # Set table prefix
    sed -i "" "s/%%REPLACEPREFIX_%%/${table_prefix}/g" ~/$dir/wp-config.php

    sed -i "" "s/%%REPLACEPREFIX_%%/${table_prefix}/g" ~/$local/$dir/wp-config.php
    # Cleanup
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php
    rm -rf ~/$dir/wordpress
    rm -rf ~/$dir/b3313c7457647cb0544c/
    rm -rf ~/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/
    rm -rf ~/$dir/wp-content/themes/$theme/19a995445b52786194e5/
    rm -rf ~/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/
    rm -rf ~/$dir/wp-content/themes/twenty*
    rm -rf ~/$dir/wp-content/themes/$theme/.git
    rm ~/$dir/wp-content/themes/$theme/CONTRIBUTING.md
    rm ~/$dir/keys.txt

    rm ~/$local/$dir/latest.tar.gz
    rm ~/$local/$dir/wp-config-sample.php
    rm -rf ~/$local/$dir/wordpress
    rm -rf ~/$local/$dir/b3313c7457647cb0544c/
    rm -rf ~/$local/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/
    rm -rf ~/$local/$dir/wp-content/themes/$theme/19a995445b52786194e5/
    rm -rf ~/$local/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/
    rm -rf ~/$local/$dir/wp-content/themes/twenty*
    rm -rf ~/$local/$dir/wp-content/themes/$theme/.git
    rm ~/$local/$dir/wp-content/themes/$theme/CONTRIBUTING.md
    rm ~/$local/$dir/keys.txt
    # Verify wp-config
    cat ~/$dir/wp-config.php
    cat ~/$local/$dir/wp-config.php
  3. jsoningram revised this gist May 25, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -111,7 +111,6 @@ rm -rf ~/$dir/wp-content/themes/twenty*
    rm -rf ~/$dir/wp-content/themes/$theme/.git
    rm ~/$dir/wp-content/themes/$theme/CONTRIBUTING.md
    rm ~/$dir/keys.txt
    rm ~/$dir/dbpass.txt

    # Verify wp-config
    cat ~/$dir/wp-config.php
  4. jsoningram revised this gist May 25, 2015. 1 changed file with 89 additions and 21 deletions.
    110 changes: 89 additions & 21 deletions wpbase
    Original file line number Diff line number Diff line change
    @@ -1,41 +1,51 @@
    #!/bin/bash
    # Set up WP install with base plugins and CabbageCMS
    # Usage: wpbase <dirname>
    # Install WordPress and Zurb Foundation
    # Usage: wpbase <dirname> <themename>
    # Assumes you're in your home directory and installing into ~/DIRNAME

    dir=$1
    theme=$2

    # Set table prefix
    random_number=$RANDOM
    sep='_'
    table_prefix=$theme$random_number$sep

    # Set production info
    dbpass=$(env LC_CTYPE=C tr -dc "a-zA-Z0-9&*(){}_+?><~;\!@#$%^" < /dev/urandom | head -c 15)
    dbun=$RANDOM$theme

    # Get secret keys
    curl https://api.wordpress.org/secret-key/1.1/salt/ > ~/$dir/keys.txt

    # Install latest WP
    cd ~/$dir
    wget https://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    # Install base plugins
    git clone https://[email protected]/jsoningram/wpbase.git ~/$dir/wp-content/plugins/wpbase
    cd ~/$dir/wp-content/plugins/wpbase
    unzip '*.zip'
    mv ~/$dir/wp-content/plugins/wpbase/* ~/$dir/wp-content/plugins

    # Install CabbageCMS
    git clone https://github.com/jsoningram/cabbagecms.git ~/$dir/wp-content/plugins/cabbagecms

    # Install _s
    git clone https://github.com/Automattic/_s.git ~/$dir/wp-content/themes/$theme

    # Download bower file from gist
    cd ~/$dir/wp-content/themes/$theme/
    git clone https://gist.github.com/19a995445b52786194e5.git
    mv ~/$dir/wp-content/themes/$theme/19a995445b52786194e5/bower.json ~/$dir/wp-content/themes/$theme/bower.json

    # Download package file for gulp from gist
    cd ~/$dir/wp-content/themes/$theme/
    git clone https://gist.github.com/d1cf5b837a6831136599.git
    mv ~/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/package.json ~/$dir/wp-content/themes/$theme/package.json

    # Download wp-config from gist
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    git clone https://gist.github.com/b3313c7457647cb0544c.git
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php

    # Cleanup
    rm -rf ~/$dir/wp-content/plugins/wpbase
    rm ~/$dir/wp-content/plugins/*.zip
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php
    rm -rf ~/$dir/wordpress
    rm -rf ~/$dir/b3313c7457647cb0544c/
    # Download Foundation init from gist
    cd ~/$dir/wp-content/themes/$theme/js
    git clone https://gist.github.com/d8958509b2dccaf5e2ff.git
    mv ~/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/foundation-init.js ~/$dir/wp-content/themes/$theme/js/foundation-init.js

    # Namespace theme
    cd ~/$dir/wp-content/themes/$theme
    @@ -45,5 +55,63 @@ find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/Text Do
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/ _s/ $theme/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/_s-/${theme}-/g"

    # Open wp-config for editing
    vi ~/$dir/wp-config.php
    # Structure
    mkdir ~/$dir/wp-content/themes/$theme/fonts
    mkdir ~/$dir/wp-content/themes/$theme/css
    mkdir ~/$dir/wp-content/themes/$theme/images
    mkdir ~/$dir/wp-content/themes/$theme/images/working
    mkdir ~/$dir/wp-content/themes/$theme/images/source
    touch ~/$dir/wp-content/themes/$theme/css/googlefonts.css

    # Create .bowerrc in theme folder
    echo '{"directory" : "components"}' > ~/$dir/wp-content/themes/$theme/.bowerrc

    # Create base .gitignore in theme folder
    echo '.DS_STORE
    /components
    /node_modules
    /images/source
    /images/working' > ~/$dir/wp-content/themes/$theme/.gitignore

    # Install components
    cd ~/$dir/wp-content/themes/$theme/
    bower install

    # Create empty Git repo in the theme directory
    git init ~/$dir/wp-content/themes/$theme/

    # Set DB, DB user and pass ("" after -i for OS X)
    sed -i "" "s/DEV_DBNAME/${theme}/g" ~/$dir/wp-config.php
    sed -i "" "s/DEV_DBUSER/${theme}/g" ~/$dir/wp-config.php
    sed -i "" "s/DEV_DBPASS/${theme}/g" ~/$dir/wp-config.php

    sed -i "" "s/PRODUCTION_DBNAME/${dbun}/g" ~/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBUSER/${dbun}/g" ~/$dir/wp-config.php
    sed -i "" "s/PRODUCTION_DBPASS/${dbpass}/g" ~/$dir/wp-config.php

    # Set secret keys
    cd ~/$dir
    sed -i "" "/%%SECRET_KEYS%%/{
    s/%%SECRET_KEYS%%//g
    r keys.txt
    }" ~/$dir/wp-config.php

    # Set table prefix
    sed -i "" "s/%%REPLACEPREFIX_%%/${table_prefix}/g" ~/$dir/wp-config.php

    # Cleanup
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php
    rm -rf ~/$dir/wordpress
    rm -rf ~/$dir/b3313c7457647cb0544c/
    rm -rf ~/$dir/wp-content/themes/$theme/js/d8958509b2dccaf5e2ff/
    rm -rf ~/$dir/wp-content/themes/$theme/19a995445b52786194e5/
    rm -rf ~/$dir/wp-content/themes/$theme/d1cf5b837a6831136599/
    rm -rf ~/$dir/wp-content/themes/twenty*
    rm -rf ~/$dir/wp-content/themes/$theme/.git
    rm ~/$dir/wp-content/themes/$theme/CONTRIBUTING.md
    rm ~/$dir/keys.txt
    rm ~/$dir/dbpass.txt

    # Verify wp-config
    cat ~/$dir/wp-config.php
  5. jsoningram revised this gist May 23, 2015. 1 changed file with 23 additions and 8 deletions.
    31 changes: 23 additions & 8 deletions wpbase
    Original file line number Diff line number Diff line change
    @@ -1,34 +1,49 @@
    #!/bin/bash
    # Set up WP install with base plugins
    # Set up WP install with base plugins and CabbageCMS
    # Usage: wpbase <dirname>
    # Assumes you're in your home directory and installing into ~/DIRNAME

    dir=$1
    theme=$2

    # Install latest WP
    cd ~/$dir
    wget https://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    # Install my favorite plugins. This is a private repo... sorry
    # Install base plugins
    git clone https://[email protected]/jsoningram/wpbase.git ~/$dir/wp-content/plugins/wpbase
    cd ~/$dir/wp-content/plugins/wpbase
    unzip '*.zip'
    mv ~/$dir/wp-content/plugins/wpbase/* ~/$dir/wp-content/plugins

    # Install custom plugin from GitHub
    # Install CabbageCMS
    git clone https://github.com/jsoningram/cabbagecms.git ~/$dir/wp-content/plugins/cabbagecms

    # Install _s
    git clone https://github.com/Automattic/_s.git ~/$dir/wp-content/themes/$theme

    # Download wp-config from gist
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php

    # Cleanup
    rm -rf ~/$dir/wp-content/plugins/wpbase
    rm ~/$dir/wp-content/plugins/*.zip
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php

    # Download and open custom wp-config for edting
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php
    rm -rf ~/$dir/wordpress
    rm -rf ~/$dir/b3313c7457647cb0544c/

    # Namespace theme
    cd ~/$dir/wp-content/themes/$theme
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/'_s'/'$theme'/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/_s_/${theme}_/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/Text Domain: _s/Text Domain: $theme/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/ _s/ $theme/g"
    find -E . -regex '.*\.(php|css|scss)' -print0 | xargs -0 sed -i '' -e "s/_s-/${theme}-/g"

    # Open wp-config for editing
    vi ~/$dir/wp-config.php
  6. jsoningram revised this gist May 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ rm ~/$dir/wp-content/plugins/*.zip
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php

    # Download and open cusotm wp-config for edting
    # Download and open custom wp-config for edting
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php
  7. jsoningram revised this gist Apr 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ dir=$1

    # Install latest WP
    cd ~/$dir
    wget http://wordpress.org/latest.tar.gz
    wget https://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

  8. jsoningram revised this gist Aug 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ wget http://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    # Install base plugins. This is a private repo... sorry
    # Install my favorite plugins. This is a private repo... sorry
    git clone https://[email protected]/jsoningram/wpbase.git ~/$dir/wp-content/plugins/wpbase
    cd ~/$dir/wp-content/plugins/wpbase
    unzip '*.zip'
  9. jsoningram revised this gist Aug 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ rm ~/$dir/wp-content/plugins/*.zip
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php

    # Download and open config for edting
    # Download and open cusotm wp-config for edting
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php
  10. jsoningram revised this gist Aug 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ wget http://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    # Install base plugins
    # Install base plugins. This is a private repo... sorry
    git clone https://[email protected]/jsoningram/wpbase.git ~/$dir/wp-content/plugins/wpbase
    cd ~/$dir/wp-content/plugins/wpbase
    unzip '*.zip'
  11. jsoningram revised this gist Aug 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpbase
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash
    # Set up WP install with base plugins
    # Usage: wpbase <dirname>
    # Assumes you're in your home directory and installing into a directory in home
    # Assumes you're in your home directory and installing into ~/DIRNAME

    dir=$1

  12. jsoningram created this gist Aug 9, 2014.
    34 changes: 34 additions & 0 deletions wpbase
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/bin/bash
    # Set up WP install with base plugins
    # Usage: wpbase <dirname>
    # Assumes you're in your home directory and installing into a directory in home

    dir=$1

    # Install latest WP
    cd ~/$dir
    wget http://wordpress.org/latest.tar.gz
    tar -xzvf latest.tar.gz
    mv wordpress/* ~/$dir

    # Install base plugins
    git clone https://[email protected]/jsoningram/wpbase.git ~/$dir/wp-content/plugins/wpbase
    cd ~/$dir/wp-content/plugins/wpbase
    unzip '*.zip'
    mv ~/$dir/wp-content/plugins/wpbase/* ~/$dir/wp-content/plugins

    # Install custom plugin from GitHub
    git clone https://github.com/jsoningram/cabbagecms.git ~/$dir/wp-content/plugins/cabbagecms

    # Cleanup
    rm -rf ~/$dir/wp-content/plugins/wpbase
    rm ~/$dir/wp-content/plugins/*.zip
    rm ~/$dir/latest.tar.gz
    rm ~/$dir/wp-config-sample.php

    # Download and open config for edting
    cd ~/$dir
    git clone https://gist.github.com/b3313c7457647cb0544c.git b3313c7457647cb0544c
    mv ~/$dir/b3313c7457647cb0544c/wp-config.php ~/$dir/wp-config.php
    rm -rf ~/$dir/b3313c7457647cb0544c/
    vi ~/$dir/wp-config.php