From 9fa4d8839dfe609488c31b1119dbde6fe8f8e21e Mon Sep 17 00:00:00 2001 From: poliphant <166876505+poliphant@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:41:56 -0500 Subject: [PATCH 1/2] Update makeself-header.sh to better handle relative paths and provide a launching script name to a startup_script Update the ARCHIVE_DIR variable to provide an absolute path even when the makeself script is launched with a relative path. An absolute path is needed when the startup script is ask to place folder and files in a directory relative to the makeself script location. Add the ARCHIVE_BASE variable. This provides the name of the originating makeself script. This is useful to provide feedback to the user in for example 'usage' messages. --- makeself-header.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makeself-header.sh b/makeself-header.sh index 8c5b229..1b0608d 100755 --- a/makeself-header.sh +++ b/makeself-header.sh @@ -15,8 +15,11 @@ SIGNATURE="$Signature" TMPROOT=\${TMPDIR:=/tmp} USER_PWD="\$PWD" export USER_PWD -ARCHIVE_DIR=\`dirname "\$0"\` +ARCHIVE_DIR=\$( cd -- "\$(dirname "\$0")" >/dev/null 2>&1 ; echo \$PWD ) export ARCHIVE_DIR +ARCHIVE_BASE=\`basename "\$0"\` +export ARCHIVE_BASE + label="$LABEL" script="$SCRIPT" From b3a9a75c5398a924ee050f8cb17da49e1dcdac3f Mon Sep 17 00:00:00 2001 From: poliphant <166876505+poliphant@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:20:06 -0500 Subject: [PATCH 2/2] Update makeself-header.sh replaced with back ticks for better backward compatibility --- makeself-header.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makeself-header.sh b/makeself-header.sh index 1b0608d..760c8a1 100755 --- a/makeself-header.sh +++ b/makeself-header.sh @@ -15,12 +15,11 @@ SIGNATURE="$Signature" TMPROOT=\${TMPDIR:=/tmp} USER_PWD="\$PWD" export USER_PWD -ARCHIVE_DIR=\$( cd -- "\$(dirname "\$0")" >/dev/null 2>&1 ; echo \$PWD ) +ARCHIVE_DIR=\` cd -- "\`dirname "\$0"\`" >/dev/null 2>&1 ; echo \$PWD \` export ARCHIVE_DIR ARCHIVE_BASE=\`basename "\$0"\` export ARCHIVE_BASE - label="$LABEL" script="$SCRIPT" scriptargs="$SCRIPTARGS"