Skip to content

Instantly share code, notes, and snippets.

@villimagg
Last active December 15, 2015 07:49
Show Gist options
  • Save villimagg/5226292 to your computer and use it in GitHub Desktop.
Save villimagg/5226292 to your computer and use it in GitHub Desktop.
An artisan executable to store under the bin/ directory for easy artisan commands and easy installation of an instance of Laravel 4 for creating new projects.
#!/bin/bash
if [ -f "./artisan" ]; then
php artisan "$@"
else
if [ "$1" == "new" ]; then
if [ ! `which git` ]; then
echo "For this installer to work you'll need to install Git."
echo ' http://git-scm.com/'
fi
git clone -b develop --recursive git://github.com/laravel/laravel.git "./$2";
cd "$2";
git reset --hard HEAD
# Do the house cleaning
chmod -R 0777 app/storage
if [ ! "./composer" ]; then
echo "Composer not detected. Fetching it..."
curl -s https://getcomposer.org/installer | php -- --install-dir=bin
echo "Composer now available as a command."
fi
composer self-update
COMPOSER_PROCESS_TIMEOUT=4000 composer install
php artisan key:generate
else
echo 'This is not a valid laravel installation so artisan is a bit lost.'
echo ' http://laravel.com/docs/install#installation'
fi
fi
@richlove1
Copy link

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment