Skip to content

Commit 395e522

Browse files
Added validation before copying file and fix build command error (#8553)
1 parent 5277be0 commit 395e522

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ct/guardian.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ if check_for_gh_release "guardian" "HydroshieldMKII/Guardian" ; then
4040
msg_ok "Backed up Database"
4141
fi
4242

43-
cp /opt/guardian/.env /opt
43+
[[ -f "/opt/guardian/.env" ]] && cp "/opt/guardian/.env" "/opt"
4444
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian"
45-
mv /opt/.env /opt/guardian
45+
[[ -f "/opt/.env" ]] && mv "/opt/.env" "/opt/guardian"
4646

4747
if [[ -f "/tmp/plex-guard.db.backup" ]] ; then
4848
msg_info "Restoring Database"
@@ -58,7 +58,8 @@ if check_for_gh_release "guardian" "HydroshieldMKII/Guardian" ; then
5858

5959
cd /opt/guardian/frontend
6060
$STD npm ci
61-
$STD DEPLOYMENT_MODE=standalone npm run build
61+
export DEPLOYMENT_MODE=standalone
62+
$STD npm run build
6263
msg_ok "Updated Guardian"
6364

6465
msg_info "Starting Services"

0 commit comments

Comments
 (0)