Skip to content

Commit 3992a9e

Browse files
author
Steevan BARBOYON
committed
Add init() function
1 parent beb7e2d commit 3992a9e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

init_benchmark.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,29 @@
22

33
function clearCacheAndLogs() {
44
sudo rm -rf app/cache/*
5+
[ "$?" != "0" ] && exit 1
56
sudo chmod -R 777 app/cache
7+
[ "$?" != "0" ] && exit 1
68

79
sudo rm -rf app/logs/*
10+
[ "$?" != "0" ] && exit 1
811
sudo chmod -R 777 app/logs
12+
[ "$?" != "0" ] && exit 1
913
}
1014

11-
clearCacheAndLogs
15+
function init() {
16+
clearCacheAndLogs
1217

13-
export SYMFONY_ENV=prod
14-
composer install --no-dev --optimize-autoloader
18+
export SYMFONY_ENV=prod
19+
composer install --no-dev --optimize-autoloader
20+
[ "$?" != "0" ] && exit 1
1521

16-
php app/console assets:install --symlink --env=prod
17-
php app/console assetic:dump --env=prod
22+
php app/console assets:install --symlink --env=prod
23+
[ "$?" != "0" ] && exit 1
24+
php app/console assetic:dump --env=prod
25+
[ "$?" != "0" ] && exit 1
1826

19-
clearCacheAndLogs
27+
clearCacheAndLogs
28+
29+
return 0
30+
}

0 commit comments

Comments
 (0)