Skip to content
Snippets Groups Projects
Commit 5fb3bb88 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.lc_fsmap bugfix

parent 280b0e77
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,9 @@ function lc_include () {
function lci_fsmap () {
# If existing symlink is correct, do nothing & return 0 (success).
# Otherwise, delete the existing symlink. If the existing item is file/folder, move to '$filename.linuxsync_backup'.
# Otherwise, delete the existing symlink.
# If the existing item is file/folder, move to '$filename.linuxsync_backup'.
# If target folder doesn't exist, create it.
# Then create a symlink.
local content_path="$(realpath "$1")" || return $?
......@@ -75,6 +77,8 @@ function lci_fsmap () {
mv "$symlink_path" "${symlink_path}.linuxsync_backup" || rm -f "$symlink_path" || return $?
fi
[ -d "$(dirname "$symlink_path")" ] || mkdir -p "$(dirname "$symlink_path")" || return $?
ln -s "$content_path" "$symlink_path"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment