From 4204a1e85a3220a6ea0c04819f2e18f3240ffb17 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sat, 6 Jun 2026 19:49:55 -0700 Subject: [PATCH] =?UTF-8?q?fix(@scripts):=20=F0=9F=90=9B=20handle=20tilde?= =?UTF-8?q?=20and=20relative=20paths=20in=20session=20dir=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/crc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/crc b/bin/crc index be4069d..3eaec1c 100755 --- a/bin/crc +++ b/bin/crc @@ -107,7 +107,15 @@ REL=$(printf %q "$rel") ABS=$(printf %q "$abs") RC_ARGS=$(printf %q "$rc_args") SESS=$(printf %q "$session") -if [ -n "\$ABS" ]; then DIR=\$ABS; else DIR="\$HOME\${REL:+/\$REL}"; fi +if [ -n "\$ABS" ]; then + case "\$ABS" in + "~") DIR=\$HOME ;; + "~/"*) DIR="\$HOME/\${ABS#~/}" ;; + *) DIR=\$ABS ;; + esac +else + DIR="\$HOME\${REL:+/\$REL}" +fi if ! cd "\$DIR" 2>/dev/null; then echo "crc: directory not found on host: \$DIR" >&2 exit 1