Detect and warn about unresolved Git merge conflicts

This commit is contained in:
JannisX11 2024-06-08 15:40:54 +02:00
parent b740c56376
commit 3135869903
2 changed files with 9 additions and 0 deletions

View File

@ -582,6 +582,14 @@ function autoParseJSON(data, feedback) {
data = JSON.parse(data)
} catch (err) {
if (feedback === false) return;
if (data.match(/\n\r?[><]{7}/)) {
Blockbench.showMessageBox({
title: 'message.invalid_file.title',
icon: 'fab.fa-git-alt',
message: 'message.invalid_file.merge_conflict'
})
return;
}
let error_part = '';
function logErrantPart(whole, start, length) {
var line = whole.substr(0, start).match(/\n/gm)

View File

@ -246,6 +246,7 @@
"message.screenshot.right_click": "Right click or long press the screenshot to copy",
"message.invalid_file.title": "Invalid File",
"message.invalid_file.message": "Could not open json file: %0",
"message.invalid_file.merge_conflict": "The file contains unresolved Git merge conflicts.",
"message.invalid_model.title": "Invalid Model File",
"message.invalid_model.message": "This file does not contain valid model data.",
"message.invalid_format.title": "Invalid Format",