-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·55 lines (44 loc) · 1.69 KB
/
setup.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#Setup Development Environment
#base from https://codesandbox.io/s/happy-hopper-lp2cqx?file=/setup.sh:0-2132
echo -e "Let's quickly setup your development environment:"
#1 - Do you have Docker Desktop installed?
read -p "Do you have Docker Desktop installed and is it currently running? Y/n " IS_DOCKER_DESKTOP_INSTALLED
case $IS_DOCKER_DESKTOP_INSTALLED in
[yY] | "" ) ;;
[nN] ) echo 'Please install Desktop Docker before continuing https://www.docker.com/products/docker-desktop/';
exit;;
* ) echo $IS_DOCKER_DESKTOP_INSTALLED is an invalid response, please enter y or n;
exit 1;;
esac
#2 - Do you have Node installed?
read -p "Do you have Node installed? Y/n " IS_NODEJS_INSTALLED
case $IS_NODEJS_INSTALLED in
[yY] | "" ) ;;
[nN] ) echo 'Please install Node before continuing https://nodejs.org/en/';
exit;;
* ) echo $IS_NODEJS_INSTALLED is an invalid response, please enter y or n;
exit 1;;
esac
#2 - Do you have Composer installed?
read -p "Do you have Composer installed? Y/n " IS_COMPOSER_INSTALLED
case $IS_COMPOSER_INSTALLED in
[yY] | "" ) ;;
[nN] ) echo 'Please install Composer before continuing https://getcomposer.org/download/';
exit;;
* ) echo $IS_COMPOSER_INSTALLED is an invalid response, please enter y or n;
exit 1;;
esac
#3 - Copy ENV file:
cd ./apps/web && cp .env.example .env
#4 - Install Next.js:
echo Installing dependencies...
cd ../.. && pnpm install && composer install
#5 - Install WordPress (Docker Desktop must be running):
cd ./apps/wp/config && chmod +x install.sh && ./install.sh
read -p "Press [Enter ↩] when you have completed the steps listed above." HAS_IMPORTED_ACF
if [[ "$HAS_IMPORTED_ACF" == "" ]]
then
cd ../../ && pnpm run dev
fi
exit 0