helm/bin/project-root
Henrik Lissner c4be365696 Global bash/zsh aliases + new programs
+ add common.sh and common aliases
+ add bin/{since,til}
+ add bin/project-root
+ extract btl alias into bin/transmission-list
2015-12-21 01:30:42 -05:00

12 lines
253 B
Bash
Executable file

#!/usr/bin/env bash
local dir="${PWD%/*}"
while [[ ! -d "$dir/.git" && ! -d "$dir/.hg" && ! -d "$dir/.svn" && ! -f "$dir/.project" ]]; do
dir="${dir%/*}"
if [[ -z "$dir" ]]; then
echo -n "$PWD"
return
fi
done
echo -n "$dir"