summaryrefslogtreecommitdiff
path: root/.config/shells/utils/funcrc
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-02-21 17:11:05 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-02-21 17:11:05 -0500
commit960a05363ae9c0b767d57405cfffe9f8a6b021cd (patch)
tree41aca6d3abd2aa7408b2c24f4f9ff0c08ad475cb /.config/shells/utils/funcrc
parent8276fb9c65e40605f7d56dac3326b3f9f90c615d (diff)
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.
Diffstat (limited to '.config/shells/utils/funcrc')
-rwxr-xr-x.config/shells/utils/funcrc22
1 files changed, 22 insertions, 0 deletions
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
+}
+