From 3130eb0172f65dee8355b292385f3aa76c4f2dfb Mon Sep 17 00:00:00 2001 From: Trevon Date: Wed, 19 Apr 2023 00:06:00 -0400 Subject: [PATCH 1/4] Update activate Moved "export KCTF_CTF_DIR" into macOS check to use grealpath instead of realpath which doesn't seem supported. --- dist/activate | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/activate b/dist/activate index cdbaec1e..587d1cc9 100644 --- a/dist/activate +++ b/dist/activate @@ -24,6 +24,8 @@ if [[ "$OSTYPE" =~ ^darwin.* ]]; then STAT="gstat" MKTEMP="gmktemp" + export KCTF_CTF_DIR="$(grealpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + else KCTF_YQ_URL="https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64" KCTF_YQ_HASH="5d44bd64e264e9029c5f06bcd960ba162d7ed7ddd1781f02a28d62f50577b632" @@ -36,9 +38,9 @@ else STAT="stat" MKTEMP="mktemp" + export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" fi -export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" export KCTF_BIN="${KCTF_CTF_DIR}/kctf/bin" source "${KCTF_BIN}/kctf-log" From de431e3251dd1b8c7801d88639fe3a6249014e37 Mon Sep 17 00:00:00 2001 From: Trevon Date: Wed, 19 Apr 2023 00:06:00 -0400 Subject: [PATCH 2/4] Update activate Moved "export KCTF_CTF_DIR" into macOS check to use grealpath instead of realpath which doesn't seem supported. --- dist/activate | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/activate b/dist/activate index cdbaec1e..587d1cc9 100644 --- a/dist/activate +++ b/dist/activate @@ -24,6 +24,8 @@ if [[ "$OSTYPE" =~ ^darwin.* ]]; then STAT="gstat" MKTEMP="gmktemp" + export KCTF_CTF_DIR="$(grealpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + else KCTF_YQ_URL="https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64" KCTF_YQ_HASH="5d44bd64e264e9029c5f06bcd960ba162d7ed7ddd1781f02a28d62f50577b632" @@ -36,9 +38,9 @@ else STAT="stat" MKTEMP="mktemp" + export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" fi -export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" export KCTF_BIN="${KCTF_CTF_DIR}/kctf/bin" source "${KCTF_BIN}/kctf-log" From 14cf4de65d1f8b4f20f2666b27366d1766a1214b Mon Sep 17 00:00:00 2001 From: Trevon Date: Thu, 20 Apr 2023 12:41:52 -0400 Subject: [PATCH 3/4] updating activate to include both grealpath and realpath --- dist/activate | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/activate b/dist/activate index 587d1cc9..0627bd78 100644 --- a/dist/activate +++ b/dist/activate @@ -24,7 +24,12 @@ if [[ "$OSTYPE" =~ ^darwin.* ]]; then STAT="gstat" MKTEMP="gmktemp" - export KCTF_CTF_DIR="$(grealpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + if ! grealpath &> /dev/null + then + export KCTF_CTF_DIR="$(grealpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + else + export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + fi else KCTF_YQ_URL="https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64" From c6c7efd50f0a747accd1fef5578ec59e87c5c5e2 Mon Sep 17 00:00:00 2001 From: Trevon Date: Wed, 26 Apr 2023 09:35:54 -0400 Subject: [PATCH 4/4] updating fix per @sroettger's suggestion --- dist/activate | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/activate b/dist/activate index 0627bd78..6f189c80 100644 --- a/dist/activate +++ b/dist/activate @@ -24,13 +24,13 @@ if [[ "$OSTYPE" =~ ^darwin.* ]]; then STAT="gstat" MKTEMP="gmktemp" - if ! grealpath &> /dev/null - then - export KCTF_CTF_DIR="$(grealpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" - else - export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")" + + script_dir="$(dirname "${BASH_SOURCE-$0}")" + if [[ "$script_dir" == "." ]]; then + script_dir="../." fi - + export KCTF_CTF_DIR="$(realpath "$(dirname "${script_dir}")")" + unset script_dir else KCTF_YQ_URL="https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64" KCTF_YQ_HASH="5d44bd64e264e9029c5f06bcd960ba162d7ed7ddd1781f02a28d62f50577b632"