Drupal 8 installation (bash) script. I want the latest stable v8 version each time. But how? My Drupal 7 script utilised a make file which specified '7.x' as the Drupal version to install, drush make would fetch the correct core files.

My current Drupal 8 script uses git to clone and then checkout a version, eg. 8.1.0, and then renames the remotes as per the instructions on this page. However since this method downloads the entire Drupal project history, I end up with a huge project folder.

I work for an agency and we install Drupal for website projects, so our need is not for the latest dev builds, otherwise I image I would just use:

git clone --depth=1 [url to drupal.git]


I'm looking for a way to clone the latest stable (release) v8 branch, with no extra files. I could specify the zip on the release page, but this would mean updating the script upon each new release. I tried using Composer, but ended up with a much more complex than necessary folder structure.

Can someone help me with a way to get essentially a copy of the latest v8 .zip file via a script?

Thanks!
As mradcliffe said in the comment, if you don't want to use composer (which I would really recommend you look into), you can simply use drush. You just need this:

drush dl drupal


This defaults to the latest stable Drupal 8 version. If you want to have a git clone (which is way slower), you can tell drush to do that too:

drush dl --package-handler=git_drupalorg drupal