From 1d9b3779c76597fea2957f3519609cd491e8e1ee Mon Sep 17 00:00:00 2001
From: Scott Lahteine <thinkyhead@users.noreply.github.com>
Date: Tue, 12 Nov 2024 17:13:04 -0600
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20path=20handling=20for=20ge?=
 =?UTF-8?q?neric=20variant?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../share/PlatformIO/scripts/generic_create_variant.py      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/buildroot/share/PlatformIO/scripts/generic_create_variant.py b/buildroot/share/PlatformIO/scripts/generic_create_variant.py
index 60c36c7f243b..cfab812e1503 100644
--- a/buildroot/share/PlatformIO/scripts/generic_create_variant.py
+++ b/buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -51,6 +51,8 @@
 
     # Make sure the local variant sub-folder exists
     if marlin_variant_pattern.match(str(variant).lower()):
-        source_dir = Path("buildroot/share/PlatformIO/variants", variant)
+        here = Path.cwd()
+        variants_dir = here / 'buildroot' / 'share' / 'PlatformIO' / 'variants'
+        source_dir = variants_dir / variant
         assert source_dir.is_dir()
-        board.update("build.variants_dir", "buildroot/share/PlatformIO/variants");
+        board.update("build.variants_dir", str(variants_dir));