Define PREFIX is arg is a dir.

This commit is contained in:
Daniel Nichter
2012-07-23 14:13:35 -06:00
parent 8a8c7749f6
commit b90a375cb5

View File

@@ -85,6 +85,7 @@ main() {
ARG="${1:-.}"
if [ -d "${ARG}" ]; then
BASEDIR="$(echo "${ARG}" | sed -e 's!/$!!')"
PREFIX=""
elif [ -f "${ARG}" -o -f "${ARG}-df" -o -f "${ARG}df" ]; then
BASEDIR="$(dirname "${ARG}")"
PREFIX="$(echo "${ARG}" | sed -e 's/-[a-z1]*$//' -e 's!^.*/!!')"