-
-
Save BFTrick/11294357 to your computer and use it in GitHub Desktop.
curl -O https://wordpress.org/latest.zip | |
unzip latest.zip | |
mv wordpress site | |
rm latest.zip |
Curl will get a corrupted zip if you use the http url as it's moved permanently, so you should instead use the https url:
curl -O https://wordpress.org/latest.zip
use curl -LO https://wordpress.org/latest.zip
to follow any redirects otherwise you'll download an empty file
@Deftwun thanks man!
use
curl -LO https://wordpress.org/latest.zip
to follow any redirects otherwise you'll download an empty file
What a legend.
Assuming you want something like the following file structure:
ProjectName/Repo/.git/
/public/
You can get started really quickly by doing the following:
cd ProjectName/Repo
... this should be an empty directory.
Then run this as one big command:
git init && \
curl https://raw.githubusercontent.com/github/gitignore/master/WordPress.gitignore > .gitignore && \
curl -LO https://wordpress.org/latest.zip && \
unzip latest.zip && \
rm latest.zip && \
mv wordpress public && \
mv ./public/wp-config-sample.php ./wp-config.php
I should note that I keep wp-config.php
one level above the web root, which is what the last line does. If that's not your thing, kill the last line and the && \
from the second-to-last line.
Hope that helps someone kick off a new project faster.
... I suppose you could go ahead and add the first commit too.
git add --all && \
git commit -sq -m "Initial commit of Wordpress core files. Hello World."
I updated the link in the original code. Thanks @aymanalzarrad!
For those who want to move the wordpress
folder to their current directory, should change:
mv wordpress site
to mv wordpress/* ./
Good follow-up to this post - https://gist.github.com/Adirael/3383404