forked from laracasts/URL-Shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·29 lines (21 loc) · 924 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
echo "Let's get started."
echo Installing generators
gsed -i 's/"4.1.*"/"4.1.*",\n\t\t"way\/generators": "1.1"/' composer.json
gsed -i "s/WorkbenchServiceProvider',/WorkbenchServiceProvider',\n\t\t'Way\\\Generators\\\GeneratorsServiceProvider'/" app/config/app.php
echo Updating composer
composer update
echo Creating MySQL database
mysql -uroot -p -e "CREATE DATABASE larademos"
echo Updating database configuration file
gsed -i "s/'database' => 'database'/'database' => 'larademos'/" app/config/database.php
gsed -i "s/'password' => ''/'password' => '1234'/" app/config/database.php
echo -n "Do you need a users table? [yes|no] "
read -e ANSWER
if [ $ANSWER = 'yes' ]
then
echo Creating users table migration
php artisan generate:migration create_users_table --fields="username:string:unique, email:string:unique, password:string"
echo Migrating the database
php artisan migrate
fi