Skip to content

Commit 7d8b2d5

Browse files
butlerxDanielBrierton
authored andcommitted
check if the package file has changed rather then if a node muodules exists
1 parent 826e65b commit 7d8b2d5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ web/.build
3939

4040
.DS_Store
4141
*~
42-
.idea
42+
.idea
43+
.pkg.sha1

docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#! /usr/bin/env sh
2+
set -e
23
cd /usr/src/app || exit
3-
if [ ! -d "node_modules" ]; then
4+
touch .pkg.sha1
5+
OLD_SHA=$(cat .pkg.sha1)
6+
NEW_SHA=$(sha1sum package.json)
7+
if [ "$OLD_SHA" != "$NEW_SHA" ]; then
8+
echo "$NEW_SHA" > .pkg.sha1
49
npm install
510
rm -rf node_modules/cp-translations
611
ln -s /usr/src/cp-translations node_modules/cp-translations

0 commit comments

Comments
 (0)