about summary refs log tree commit diff stats
path: root/home-manager/packages/scripts/deprecated/csd
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/packages/scripts/deprecated/csd')
-rwxr-xr-xhome-manager/packages/scripts/deprecated/csd11
1 files changed, 11 insertions, 0 deletions
diff --git a/home-manager/packages/scripts/deprecated/csd b/home-manager/packages/scripts/deprecated/csd
new file mode 100755
index 00000000..33105314
--- /dev/null
+++ b/home-manager/packages/scripts/deprecated/csd
@@ -0,0 +1,11 @@
+#! /bin/zsh
+function cd () {
+    if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then
+        [[ ! -e ${1:h} ]] && return 1
+        print "Correcting ${1} to ${1:h}"
+        builtin cd ${1:h}
+    else
+        builtin cd "$@"
+    fi
+}
+