Jelajahi Sumber

Added ckgit() and cleaned up helpers a bit

Simon Watson 2 tahun lalu
induk
melakukan
3409d1160a
2 mengubah file dengan 25 tambahan dan 4 penghapusan
  1. 22 0
      bashrc/bashrc-all
  2. 3 4
      emacs/elisp/helpers.el

+ 22 - 0
bashrc/bashrc-all

@@ -92,6 +92,28 @@ pb () {
 	curl -F "file=@-" http://chate.io:669
 }
 
+ckgit () {
+    if [ ! -z $1 ]; then
+	DIR=$1
+    else
+	DIR="$HOME/Repos"
+    fi
+
+    GIT_PATH=$(which git);
+
+    for dirp in $($EXA_PATH -d $DIR/*/); do
+	if [[ -d "$dirp/.git" ]]; then
+	    RET=$($GIT_PATH -C $dirp status --porcelain)
+	    if [[ ! -z "$RET" ]]; then
+		echo "* $dirp"
+		echo "$RET"
+		echo ""
+	    fi
+	fi
+    done
+}
+
+
 # For use with emacs vterm
 # See: https://github.com/akermu/emacs-libvterm
 vterm_printf(){

+ 3 - 4
emacs/elisp/helpers.el

@@ -42,11 +42,10 @@
     (insert *last-pb-url*)
     (clipboard-kill-region (point-min) (point-max))))
 
-(defun display-pb (&optional url-arg)
-  "Display either last pb url content, or passed URL.
-Can also be used to display HTML/text via curl in new buf."
+(defun display-pb ()
+  "Display last pb url content, see *last-pb-url*"
   (interactive)
-  (let* ((url (if url-arg url-arg *last-pb-url*))
+  (let* ((url (if *last-pb-url* *last-pb-url* (error "*last-pb-url* void")))
 	(r
 	 (shell-command-to-string (format "curl -s %s" url))))
     (switch-to-buffer