forked from laravel/sail-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp.sh
executable file
·43 lines (35 loc) · 1.1 KB
/
php.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
docker info > /dev/null 2>&1
# Ensure that Docker is running...
if [ $? -ne 0 ]; then
echo "Docker is not running."
exit 1
fi
docker run --rm \
--pull=always \
-v "$(pwd)":/opt \
-w /opt \
laravelsail/php{{ php }}-composer:latest \
bash -c "laravel new {{ name }} && cd {{ name }} && php ./artisan sail:install --with={{ with }} {{ devcontainer }}"
cd {{ name }}
# Allow build with no additional services
if [ "{{ services }}" == "none" ]; then
./vendor/bin/sail build
else
./vendor/bin/sail pull {{ services }}
./vendor/bin/sail build
fi
CYAN='\033[0;36m'
LIGHT_CYAN='\033[1;36m'
BOLD='\033[1m'
NC='\033[0m'
echo ""
if sudo -n true 2>/dev/null; then
sudo chown -R $USER: .
echo -e "${BOLD}Get started with:${NC} cd {{ name }} && ./vendor/bin/sail up"
else
echo -e "${BOLD}Please provide your password so we can make some final adjustments to your application's permissions.${NC}"
echo ""
sudo chown -R $USER: .
echo ""
echo -e "${BOLD}Thank you! We hope you build something incredible. Dive in with:${NC} cd {{ name }} && ./vendor/bin/sail up"
fi