Reorganize internal functions

This commit is contained in:
2013-10-03 22:59:38 +01:00
parent ffdfc5f889
commit 4efde780d4
11 changed files with 188 additions and 146 deletions

View File

@@ -0,0 +1,15 @@
locate-target() {
if [ -n "$TARGET" ]; then
if [ ! -d "$TARGET" ]; then
echo "ERROR: Target \"$TARGET\" is not a directory." >&2
return 1
fi
elif [ -n "$HOME" ] && [ -d "$HOME" ]; then
TARGET="$HOME"
elif [ -d ~ ]; then
TARGET=~
else
echo "ERROR: Your \$HOME folder could not be found." >&2
return 1
fi
}