From 960a05363ae9c0b767d57405cfffe9f8a6b021cd Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 21 Feb 2026 17:11:05 -0500 Subject: refactor(zsh): Restructured common shell files Restructured common shell files to be in a utils directory. Operating System specific files are in the util/OS_NAME/ directories. --- .config/shells/utils/funcrc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .config/shells/utils/funcrc (limited to '.config/shells/utils/funcrc') diff --git a/.config/shells/utils/funcrc b/.config/shells/utils/funcrc new file mode 100755 index 0000000..9b31a79 --- /dev/null +++ b/.config/shells/utils/funcrc @@ -0,0 +1,22 @@ +#!/bin/sh + +cdl () { cd "${@}" && ls ;} +mkc () { mkdir "${@}" && cd "${@}" ;} + +color_wrap() { + printf "%s%s%s" %{$fg_bold[$1]%} $2 %{$reset_color%} +} + +git_good() { + REPO="$(git config --get remote.origin.url 2>/dev/null | sed -n -E 's|.*/(.*)\.git|\1|p' | tr -d '\n' )" + BRANCH="$(git branch 2>/dev/null | sed -n -E 's/\* (.*)/\1/p' | tr -d '\n')" + [[ -n $BRANCH ]] && color_wrap cyan "[$REPO::$BRANCH] " +} + +error_code() { + if [[ $1 != 0 ]]; + then + color_wrap red "["$1"]" + fi +} + -- cgit v1.2.3