add check for existance of node_modules in githook

This commit is contained in:
HF 2022-06-17 12:33:09 +02:00
parent 76dacc1b61
commit cdbed9defd

View File

@ -13,8 +13,9 @@ PFOLDER="/home/pixelpla/pixelplanet"
should_reinstall () {
local TMPFILE="${BUILDDIR}/package.json.${branch}.tmp"
local NODEDIR="${BUILDDIR}/node_modules"
local ORFILE="${BUILDDIR}/package.json"
[ -f "${TMPFILE}" ] && diff -q "${TMPFILE}" "${ORFILE}" && {
[ -f "${TMPFILE}" ] && [ -d "${NODEDIR}" ] && diff -q "${TMPFILE}" "${ORFILE}" && {
echo "package.json stil the same, no need to rerun npm install."
return 1
}