Skip to content

Commit 7ba35c4

Browse files
authored
Update activate (#392)
* Update activate Moved "export KCTF_CTF_DIR" into macOS check to use grealpath instead of realpath which doesn't seem supported. * Update activate Moved "export KCTF_CTF_DIR" into macOS check to use grealpath instead of realpath which doesn't seem supported. * updating activate to include both grealpath and realpath * updating fix per @sroettger's suggestion
1 parent ce38575 commit 7ba35c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dist/activate

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ if [[ "$OSTYPE" =~ ^darwin.* ]]; then
2424

2525
STAT="gstat"
2626
MKTEMP="gmktemp"
27+
28+
script_dir="$(dirname "${BASH_SOURCE-$0}")"
29+
if [[ "$script_dir" == "." ]]; then
30+
script_dir="../."
31+
fi
32+
export KCTF_CTF_DIR="$(realpath "$(dirname "${script_dir}")")"
33+
unset script_dir
2734
else
2835
KCTF_YQ_URL="https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64"
2936
KCTF_YQ_HASH="5d44bd64e264e9029c5f06bcd960ba162d7ed7ddd1781f02a28d62f50577b632"
@@ -36,9 +43,9 @@ else
3643

3744
STAT="stat"
3845
MKTEMP="mktemp"
46+
export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")"
3947
fi
4048

41-
export KCTF_CTF_DIR="$(realpath --no-symlinks "$(dirname "${BASH_SOURCE-$0}")/..")"
4249
export KCTF_BIN="${KCTF_CTF_DIR}/kctf/bin"
4350
source "${KCTF_BIN}/kctf-log"
4451

0 commit comments

Comments
 (0)