From 5fb3bb8868f9d5a52e74b25021cd7e3b848f7918 Mon Sep 17 00:00:00 2001
From: Recolic <git@me.recolic.net>
Date: Thu, 3 Apr 2025 00:04:53 -0700
Subject: [PATCH] .lc_fsmap bugfix

---
 linuxconf | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/linuxconf b/linuxconf
index 7c7dce5..480df8c 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"
 }
 
-- 
GitLab