Skip to content

Commit fc7fb1f

Browse files
committed
Changed the commands for recompiling assets
1 parent 0c5c4fd commit fc7fb1f

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.husky/pre-push

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33

44
set -e
55

6-
npm run prod
6+
container_id=$(docker ps -q -f name=dcmp-public);
77

8-
git status --porcelain | cut -c 3- | while read -r line; do
8+
if [ ! "$container_id" ]; then
9+
echo "Docker Containers are not running. Use: 'docker compose up -d public'"
10+
exit 1;
11+
fi
12+
13+
eval "docker exec -d $container_id npm run production --workspaces";
14+
15+
git restore --staged .
16+
17+
git status --porcelain | cut -c 3- | grep -E "^.public/" | while read -r line; do
918
git add "$line";
1019
done
1120

12-
if [ -n "$(git status --porcelain)" ]; then
21+
if [ -n "$(git diff --name-only --cached)" ]; then
1322
git commit -m "Assets recompiled for production"
1423
fi

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "cd ./resources/views/themes/bimbala && npm run dev",
5-
"development": "cd ./resources/views/themes/bimbala && npm run dev",
6-
"watch": "cd ./resources/views/themes/bimbala && npm run watch",
7-
"watch-poll": "cd ./resources/views/themes/bimbala && npm run watch-poll",
8-
"hot": "cd ./resources/views/themes/bimbala && npm run hot",
9-
"prod": "npm run production",
10-
"production": "cd ./resources/views/themes/bimbala && npm run production",
4+
"dev": "mix",
5+
"watch": "mix watch",
6+
"watch-poll": "mix watch -- --watch-options-poll=1000",
7+
"hot": "mix watch --hot",
8+
"production": "mix --production",
119
"prepare": "husky install"
1210
},
1311
"devDependencies": {
@@ -16,5 +14,6 @@
1614
"laravel-mix": "^6.0.6",
1715
"lodash": "^4.17.19",
1816
"postcss": "^8.1.14"
19-
}
17+
},
18+
"workspaces": [ "./resources/views/themes/bimbala" ]
2019
}

0 commit comments

Comments
 (0)