From 6c2eea5439c2b9a033b3a885c3681d5ead43e8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Healy?= Date: Mon, 20 Apr 2026 15:20:46 +0100 Subject: [PATCH] Add some guard-rails for directory existence. --- automation/apply.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/automation/apply.sh b/automation/apply.sh index 5528367..612bf85 100755 --- a/automation/apply.sh +++ b/automation/apply.sh @@ -1,2 +1,9 @@ #!/usr/bin/bash -./git-portfolio /root/data/small/caddy/srv/seanhealy.ie/projects/ +dst=/root/data/small/caddy/srv/seanhealy.ie/projects +dst_dir=$(dirname "$dst") +if [ ! -d "$dst_dir" ]; then + echo "Destination directory does not exist: $dst_dir" + exit 1 +fi +mkdir -p "$dst_dir" +./git-portfolio "$dst"