Compare commits

..

2 Commits

Author SHA1 Message Date
MickLesk 5223954976 Apply --include=dev to fresh installs too, for parity with update fix
Couldn't confirm within this repo why devDependencies would only be
omitted on update and not on a fresh install - create_backup/
restore_backup are plain file copies and nothing in tools.func sets
NODE_ENV or writes an .npmrc. Since npm ci runs before .env is sourced
in both scripts, apply the same explicit --include=dev to the installer
as defense-in-depth against the same class of failure.
2026-07-21 23:00:43 +02:00
MickLesk fe94c03c4f Fix Nametag update failing with missing tailwindcss module
npm ci during update ran with devDependencies omitted, likely because
NODE_ENV=production was already present in the environment by then
(npm's documented default: omit=dev when NODE_ENV=production). Since
@tailwindcss/postcss is a devDependency, the subsequent `npm run build`
failed with "Cannot find module '@tailwindcss/postcss'". Force devDeps
to be installed regardless of NODE_ENV via --include=dev.
2026-07-21 22:54:52 +02:00
4 changed files with 6 additions and 31 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ function update_script() {
msg_info "Rebuilding Application"
cd /opt/nametag
$STD npm ci
$STD npm ci --include=dev
set -a
source /opt/nametag/.env
set +a
+1 -1
View File
@@ -20,7 +20,7 @@ fetch_and_deploy_gh_release "nametag" "mattogodoy/nametag" "tarball" "latest" "/
msg_info "Setting up Application"
cd /opt/nametag
$STD npm ci
$STD npm ci --include=dev
DATABASE_URL="postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}" $STD npx prisma generate
DATABASE_URL="postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}" $STD npx prisma migrate deploy
msg_ok "Set up Application"
+2 -12
View File
@@ -5140,10 +5140,7 @@ EOF
echo -en "${YW}Select option [1-${max_option}] (default: 1, auto-remove in 60s): ${CL}"
local response=""
local read_rc
read -t 60 -r response
read_rc=$?
if [[ $read_rc -eq 0 ]]; then
if read -t 60 -r response; then
case "${response:-1}" in
1)
# Remove container
@@ -5362,20 +5359,13 @@ EOF
fi
;;
esac
elif [[ $read_rc -gt 128 ]]; then
else
# Timeout - auto-remove
echo ""
msg_info "No response - removing container ${CTID}"
pct stop "$CTID" &>/dev/null || true
pct destroy "$CTID" &>/dev/null || true
msg_ok "Container ${CTID} removed"
else
# read itself failed (e.g. broken/closed stdin, I/O error) rather than
# timing out - don't guess and destroy the container on a read we
# couldn't actually capture; keep it since that's the reversible choice.
echo ""
msg_error "Could not read your response (stdin error) - keeping container ${CTID} for safety."
msg_error "Remove it manually if not needed: pct destroy ${CTID}"
fi
# Force one final status update attempt after cleanup
+2 -17
View File
@@ -497,10 +497,7 @@ error_handler() {
fi
local response=""
local read_rc
read -t 60 -r response
read_rc=$?
if [[ $read_rc -eq 0 ]]; then
if read -t 60 -r response; then
if [[ -z "$response" || "$response" =~ ^[Yy]$ ]]; then
echo ""
if declare -f msg_info >/dev/null 2>&1; then
@@ -523,7 +520,7 @@ error_handler() {
echo -e "${YW}Container ${CTID} kept for debugging${CL}"
fi
fi
elif [[ $read_rc -gt 128 ]]; then
else
# Timeout - auto-remove
echo ""
if declare -f msg_info >/dev/null 2>&1; then
@@ -538,18 +535,6 @@ error_handler() {
else
echo -e "${GN}${CL} Container ${CTID} removed"
fi
else
# read itself failed (e.g. broken/closed stdin, I/O error) rather than
# timing out - don't guess and destroy the container on a read we
# couldn't actually capture; keep it since that's the reversible choice.
echo ""
if declare -f msg_error >/dev/null 2>&1; then
msg_error "Could not read your response (stdin error) - keeping container ${CTID} for safety."
msg_error "Remove it manually if not needed: pct destroy ${CTID}"
else
echo -e "${YW}Could not read your response (stdin error) - keeping container ${CTID} for safety.${CL}"
echo -e "${YW}Remove it manually if not needed: pct destroy ${CTID}${CL}"
fi
fi
fi
fi