nutools/legacy/instinc/uinstdir

24 lines
449 B
Plaintext
Raw Normal View History

2013-08-27 15:14:44 +04:00
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
function has_args() {
local arg
for arg in "$@"; do
case "$arg" in
-*) ;;
*) return 0;;
esac
done
return 1
}
function get_uinstdir() {
local p="$(pwd)"
while [ "$p" != "$HOME" -a "$p" != "" ]; do
if [ -f "$p/.uinst.conf" ]; then
echo "$p"
break
fi
p="${p%/*}"
done
}