From c9da1d2e01b742f9657b55798d5a0589cb6ea035 Mon Sep 17 00:00:00 2001 From: jamesrocker Date: Sat, 5 Oct 2024 05:19:18 +0100 Subject: [PATCH] add comments describing relative directory change --- code/pcgen.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/pcgen.sh b/code/pcgen.sh index 1b673869f23..fbf3035ba64 100755 --- a/code/pcgen.sh +++ b/code/pcgen.sh @@ -1,5 +1,9 @@ #!/bin/sh set -e + +# Changing the current directory temporarily to the file location. +# Ensuring the script operates relative to its own location, regardless +# of where it is run from cd "$(dirname "$0")" # Most GUIs will change directory to the location of the script