mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 10:53:01 +02:00
Check eyecatch validation
To prevent configuration file corruption
This commit is contained in:
@@ -148,7 +148,7 @@ def changeConfig(src, enabled, disabled):
|
||||
# in the defines block to modify
|
||||
if regend.match(line):
|
||||
# end of block found
|
||||
state = 0
|
||||
state = 2
|
||||
dst += line
|
||||
else:
|
||||
dstLine = ""
|
||||
@@ -172,6 +172,11 @@ def changeConfig(src, enabled, disabled):
|
||||
else:
|
||||
dst += line
|
||||
print(line.rstrip())
|
||||
elif state == 2:
|
||||
dst += line
|
||||
if state != 2:
|
||||
print("EYECATCH pair not found. Cancel changes.")
|
||||
sys.exit(255)
|
||||
return dst
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user