#!/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