diff --git a/linuxconf b/linuxconf index 7c7dce5a87892bd5cb656ef3b14c450309c7e49b..480df8c79c291db4a78be257a3502954a215a477 100755 --- a/linuxconf +++ b/linuxconf @@ -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" }