From a82b3955bb7e62ca745077ad589f46db1561ad1a Mon Sep 17 00:00:00 2001 From: ellensp Date: Fri, 9 Apr 2021 13:36:48 +1200 Subject: [PATCH] Check for old Marlin files mixed in (#21574) --- .../share/PlatformIO/scripts/preflight-checks.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 2ad1562a31..6b499a8bcd 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -73,3 +73,15 @@ for p in [ env['PROJECT_DIR'], os.path.join(env['PROJECT_DIR'], "config") ]: if os.path.isfile(os.path.join(p, f)): err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p raise SystemExit(err) + +# +# Check for old files indicating an entangled Marlin (mixing old and new code) +# +mixedin = [] +for p in [ os.path.join(env['PROJECT_DIR'], "Marlin/src/lcd/dogm") ]: + for f in [ "ultralcd_DOGM.cpp", "ultralcd_DOGM.h" ]: + if os.path.isfile(os.path.join(p, f)): + mixedin += [ f ] +if mixedin: + err = "ERROR: Old files fell into your Marlin folder. Remove %s and try again" % ", ".join(mixedin) + raise SystemExit(err)