forked from LycheeOrg/Lychee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-merge
executable file
·30 lines (26 loc) · 935 Bytes
/
post-merge
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
#!/bin/sh
NO_COLOR="\033[0m"
GREEN="\033[38;5;010m"
ORANGE="\033[38;5;214m"
echo "\n${GREEN}post merge hook start${NO_COLOR}\n"
# we check if vendor/bin/phpunit is present.
# If yes this means we are in dev mode.
PHPUNIT="vendor/bin/phpunit"
if [ -f ".NO_AUTO_COMPOSER_MIGRATE" ]; then
echo "\n${ORANGE}composer and database migration skipped as per requested.${NO_COLOR}\n"
else
if [ -x "$PHPUNIT" ]; then
echo "\n${ORANGE}Dev mode detected${NO_COLOR}\n"
echo "composer install --no-suggest"
composer install --no-suggest
else
echo "\n${ORANGE}--no-dev mode detected${NO_COLOR}\n"
echo "composer install --no-dev --prefer-dist --no-suggest"
composer install --no-dev --prefer-dist --no-suggest
fi
if [ -f ".env" ]; then
echo "php artisan migrate --force"
php artisan migrate --force
fi
fi
echo "\n${GREEN}post merge hook finish${NO_COLOR}\n"