Created
January 9, 2020 18:11
-
-
Save redlumE01/23d9a2869faeb54f7d2e7e3ba11010a2 to your computer and use it in GitHub Desktop.
python automation VVV config
This file contains hidden or 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
| # imports | |
| import sys | |
| import os | |
| import subprocess | |
| # agrument passing / var init | |
| newDir = sys.argv[1] # new directory | |
| type = sys.argv[2] # type / wp downloads dutch core | |
| os.chdir('VVV/www') | |
| os.system('mkdir ' + newDir) | |
| os.chdir(newDir) | |
| os.system('mkdir public_html') | |
| os.chdir('public_html') | |
| if type == "wp" : | |
| os.system('wp core download --locale=nl_NL') | |
| # Switch to config | |
| os.chdir('../../..') | |
| os.chdir('config') | |
| # Open with atom | |
| subprocess.Popen(["atom", 'config.yml']) | |
| # navigate to nginx sites | |
| os.chdir('nginx-config/sites') | |
| os.system('open .') | |
| # open DB software | |
| os.system('open -a "Sequel Pro"') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment