mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Basic working root link setup
This commit is contained in:
@@ -5,6 +5,13 @@ dotify-get-source-path() {
|
||||
echo "$(dirname "$dotfile")"
|
||||
}
|
||||
|
||||
dotify-get-absolute-source-path() {
|
||||
local dotfile="$(dotify-get-dotfile-path)"
|
||||
if [ "$?" != "0" ]; then return 1; fi
|
||||
|
||||
echo "$(abs_dirname "$dotfile")"
|
||||
}
|
||||
|
||||
dotify-valid-source-path() {
|
||||
dotify-get-source-path >/dev/null 2>&1
|
||||
return "$?"
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
dotify-setup-root-link() {
|
||||
return 0
|
||||
if [ -n "$DOTIFY_ROOT_LINK_IS_SETUP" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local source="$(dotify-get-absolute-source-path)"
|
||||
local target="$(dotify-get-target-path)/$(dotify-get-root-link)"
|
||||
|
||||
if [ "$source" != "$(abs_path "$target")" ]; then
|
||||
dotify-create-symlink "$source" "$target"
|
||||
fi
|
||||
|
||||
DOTIFY_ROOT_LINK_IS_SETUP="1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user