mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Reorganize internal functions
This commit is contained in:
15
src/lib/internals/locate-target.sh
Normal file
15
src/lib/internals/locate-target.sh
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user