-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.bat
103 lines (80 loc) · 2.35 KB
/
setup.bat
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@ECHO OFF
echo.
echo Hello %USERNAME%!
echo.
echo "This setup will guide you through the process of installing mobilot on your machine."
echo.
SET /p answer= ^> Have you created a MySQL database named "mobilot"? (Y/n)
IF NOT "%answer%"=="n" (
echo.
echo ^> Creating storage folders "app/storage/" ...
mkdir app\storage\logs
mkdir app\storage\cache
mkdir app\storage\meta
mkdir app\storage\sessions
mkdir app\storage\views
echo.
echo ^> Creating uploads folder "public/" ...
mkdir public\upload
echo.
echo ^> composer install
echo One moment please ...
call composer install
echo.
goto CopyDatabasePHP
)
IF "%answer%"=="n" (
echo ^> Create a database named "mobilot" and than run this script again.
exit /b
)
:CopyDatabasePHP
SET /p answer2= ^> What kind of environment are you using? (H)omestead/(X)AMPP:
SET location = ""
IF "%answer2%"=="H" (
SET location=app\config\local
goto CopiedDatabasePHP
)
IF "%answer2%"=="X" (
SET location=app\config
goto CopiedDatabasePHP
)
:CopiedDatabasePHP
echo.
echo ^> Copying "setup\database.php" to "%location%"
@xcopy /s /I setup %location%
echo.
SET /p answer3= ^> IMPORTANT: Configure %location% before continuing (press ENTER). Note that for some local environments (such as MAMP) you might need to specify a unix_socket.
echo.
echo ^> php artisan migrate
echo One moment please ...
call php artisan migrate
echo.
SET /p answer5= ^> Finally let us take a deep breath ... ... and install npm and bower modules! (press ENTER)
cd public
echo ^> npm install
npm install
echo ^> bower install
echo "When asked, always choose the later module versions required by Mobilot."
bower install
echo "> Running development build gulp task."
gulp
echo.
echo ^> Mobilot setup completed!
echo.
echo Hints:
echo ^> To manually serve Mobilot run: php artisan serve
echo ^> If something went wrong on the way like mistyping or misconfiguring the "database.php", you can confidently try repeating the process.
echo.
echo Further help – https://github.com/fhstp-mfg/mobilot/wiki/Setup
echo Report issues – https://github.com/fhstp-mfg/mobilot/issues
echo.
SET /p answer4= ^> Would you like to serve Mobilot locally? (Y/n)
IF NOT "%answer4%"=="n" (
echo ^> php artisan serve
php artisan serve
)
IF "%answer4%"=="n" (
echo ^> INFO: To serve Mobilot run: "php artisan serve"
)
echo ^> Good bye then :)
exit /b 0