-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-project.sh
38 lines (32 loc) · 907 Bytes
/
init-project.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
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# init-project.sh
# Description:
# Project specific initialization.
all_zeros='^[0]+$'
# Load logger
. .gp/bash/workspace-init-logger.sh
# Load spinner
. .gp/bash/spinner.sh
# Use this projects package json
yarn install
# remove unused scaffolding
[[ -f resources/js/components/Example.js ]] && rm resources/js/components/Example.js
[[ -f resources/views/welcome.blade.php ]] && rm resources/views/welcome.blade.php
# Migrate and Seed
declare -a exit_codes=()
msg="Migrating and seeding project database"
log "$msg"
php artisan migrate
exit_codes+=($?)
php artisan db:seed
exit_codes+=($?)
if [[ $(echo "${exit_codes[@]}" | tr -d '[:space:]') =~ $all_zeros ]]; then
log "SUCCESS: $msg"
else
log -e "ERROR: $msg"
fi
# Hot reload
msg="Setting up hot reload system"
log_silent "$msg"
if bash -ic "hot-reload setup"; then log_silent "SUCCESS: $msg"; else log_silent -e "ERROR: $msg"; fi