@@ -34,25 +34,41 @@ if [[ -n $EXAMPLE ]]; then
34
34
case $EXAMPLE in
35
35
1)
36
36
example_title=" React Example with phpMyAdmin and extras - Questions and Answers"
37
- init_example =" .gp/bash/init-react-example.sh"
37
+ init_react_example =" .gp/bash/examples /init-react-example.sh"
38
38
install_react=1
39
39
install_phpmyadmin=1
40
40
install_react_router_dom=1
41
41
rrd_ver=' ^5.2.0'
42
42
;;
43
43
2)
44
44
example_title=" React Example without phpMyAdmin and no extras - Questions and Answers"
45
- init_example =" .gp/bash/init-react-example.sh"
45
+ init_react_example =" .gp/bash/examples /init-react-example.sh"
46
46
install_react=1
47
47
install_phpmyadmin=0
48
48
install_react_router_dom=1
49
49
rrd_ver=' ^5.2.0'
50
50
;;
51
+ 10)
52
+ example_title=" Vue Example with phpMyAdmin and extras - Material Dashboard"
53
+ init_vue_example=" .gp/bash/examples/init-vue-example.sh"
54
+ install_react=0
55
+ install_vue=1
56
+ vue_auth=1
57
+ install_phpmyadmin=1
58
+ ;;
59
+ 11)
60
+ example_title=" Vue Example without phpMyAdmin and no extras - Material Dashboard"
61
+ init_vue_example=" .gp/bash/examples/init-vue-example.sh"
62
+ install_react=0
63
+ install_vue=1
64
+ vue_auth=1
65
+ install_phpmyadmin=0
66
+ ;;
51
67
* )
52
68
# Default example
53
69
# Keep this block identical to case 1)
54
70
example_title=" React Example with phpMyAdmin and extras - Questions and Answers"
55
- init_example =" .gp/bash/init-react-example.sh"
71
+ init_react_example =" .gp/bash/examples /init-react-example.sh"
56
72
install_react=1
57
73
install_phpmyadmin=1
58
74
install_react_router_dom=1
67
83
68
84
# phpmyadmin, test more for when this script fails in the middle with a non zero exit code
69
85
if [[ $install_phpmyadmin == 1 ]]; then
70
- if [[ -n $init_example ]]; then
86
+ if [[ -n $init_react_example || -n $init_vue_example ]]; then
71
87
# shellcheck source=.gp/bash/init-phpmyadmin.sh
72
88
. " $init_phpmyadmin " 2> /dev/null || log_silent -e " ERROR: $( . $init_phpmyadmin 2>&1 1> /dev/null) "
73
89
else
@@ -230,11 +246,26 @@ if [[ $laravel_major_ver != 5 ]]; then
230
246
fi
231
247
# END: optional frontend scaffolding installations
232
248
233
- # Initialize optional example project
234
- if [[ -n $init_example ]]; then
249
+ # BEGIN: optional example setup
250
+
251
+ # Initialize optional react example project
252
+ if [[ -n $init_react_example ]]; then
235
253
[[ $laravel_major_ver -ne 8 ]] \
236
- && log -e " WARNING: Examples are only supported with Laravel version 8. Your laravel version is $laravel_major_ver " \
254
+ && log -e " WARNING: React examples are only supported by Laravel version 8. Your Laravel version is $laravel_major_ver " \
237
255
&& log -e " WARNING: Ignoring the example requested: $example_title "
238
- # shellcheck source=.gp/bash/init-react-example.sh
239
- . " $init_example " 2> /dev/null || log_silent -e " ERROR: $( . $init_example 2>&1 1> /dev/null) "
240
- fi
256
+ # shellcheck source=.gp/bash/examples/init-react-example.sh
257
+ . " $init_react_example " 2> /dev/null || log_silent -e " ERROR: $( . $init_react_example 2>&1 1> /dev/null) "
258
+ exit
259
+ fi
260
+
261
+ # Initialize optional vue example project
262
+ if [[ -n $init_vue_example ]]; then
263
+ (( laravel_major_ver < 6 )) \
264
+ && log -e " WARNING: Vue examples are only supported by Laravel version 6.* or higher. Your Laravel version is $laravel_major_ver " \
265
+ && log -e " WARNING: Ignoring the example requested: $example_title "
266
+ # shellcheck source=.gp/bash/examples/init-vue-example.sh
267
+ . " $init_vue_example " 2> /dev/null || log_silent -e " ERROR: $( . $init_vue_example 2>&1 1> /dev/null) "
268
+ exit
269
+ fi
270
+
271
+ # END: optional example setup
0 commit comments