You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
217 B

#!/bin/bash
p=${1:-$(pwd)}
cd $p
g=$(git rev-parse --show-toplevel 2> /dev/null)
if [ $g != "" ]; then
basename $g
else
if [[ $p = $HOME ]]; then
echo "~$(whoami)"
else
echo ${p/${HOME}\//}
fi
fi