fix(deploy): Check if backup directory has content before restoring

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-03 16:05:04 -05:00
parent a170d6134b
commit 55cb97ca0d

View File

@@ -110,7 +110,7 @@ fi
cd "$REMOTE_DIR"
# Restore .envs secrets
if [ -d /tmp/.envs-backup ]; then
if [ -d /tmp/.envs-backup ] && [ "$(ls -A /tmp/.envs-backup 2>/dev/null)" ]; then
echo ">>> Restoring .envs secrets..."
mkdir -p "$REMOTE_DIR/smoothschedule/.envs"
cp -r /tmp/.envs-backup/* "$REMOTE_DIR/smoothschedule/.envs/"
@@ -118,7 +118,7 @@ if [ -d /tmp/.envs-backup ]; then
fi
# Restore .ssh keys
if [ -d /tmp/.ssh-backup ]; then
if [ -d /tmp/.ssh-backup ] && [ "$(ls -A /tmp/.ssh-backup 2>/dev/null)" ]; then
echo ">>> Restoring .ssh keys..."
mkdir -p "$REMOTE_DIR/smoothschedule/.ssh"
cp -r /tmp/.ssh-backup/* "$REMOTE_DIR/smoothschedule/.ssh/"