From cb2997c98eb539c40d13c7ed9dd33189941d07f9 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Mon, 14 Apr 2025 20:05:41 +0200 Subject: [PATCH] strict mode; SC2155 --- autodeploy/symlink.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autodeploy/symlink.sh b/autodeploy/symlink.sh index 569bcbd..ef0553f 100755 --- a/autodeploy/symlink.sh +++ b/autodeploy/symlink.sh @@ -1,11 +1,16 @@ #!/bin/bash +set -euo pipefail + + function symlink() { local target="$1" local link="$2" local arrow="$link -> $target" - local current_target=$(readlink "$link") + + local current_target + current_target=$(readlink "$link") # link is already correct if [ -L "$link" ] && [ "$current_target" == "$target" ]; then