12 lines
253 B
Plaintext
12 lines
253 B
Plaintext
|
#!/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"
|