diff --git a/UserScripts/active-projects b/UserScripts/active-projects new file mode 100755 index 0000000..6b67710 --- /dev/null +++ b/UserScripts/active-projects @@ -0,0 +1,78 @@ +#!/bin/bash + +# File: active-projects +# +# Description: This file finds active projects. +# +# Package: DarkFeather/HomeDir +# Copyright: WTFPL +# Author: DarkFeather /dev/null + if [ $? -eq 0 ]; then + showProject + continue + fi + + # Test for stashes + if [[ `git stash list | wc -l` -ne 0 ]]; then + showProject + continue + fi + + # Test for status + if [[ `git status | grep -cE "Your branch is up to date with 'origin/[a-zA-Z0-9]*'\.$|^nothing to commit, working tree clean$"` -ne 2 ]]; then + showProject + continue + fi + + cd "$OLDPWD" + done +} + +### Main +if [[ "$(basename "$0")" == "active-projects" ]]; then + while getopts 'At:v' OPTION; do + case "$OPTION" in + A) aninix=1 ;; + t) targetdir="${OPTARG}" ;; + v) set -x ;; + *) usage 1 ;; + esac + done + + findActiveProjects | if [ -n "$aninix" ]; then grep aninix.net; else cat; fi +fi