function applyPatch()

in patcher/web.js [61:81]


function applyPatch() {
    wrap(() => {
        let text = document.getElementById("patch")
        let newcfg = text.value.trim()
        if (!currUF2)
            log("You have to drop a UF2 or BIN file with bootloader above before applying patches.")
        else if (!newcfg)
            log("You didn't give any patch to apply.")
        else {
            let buf = currUF2.slice()
            let r = patchConfig(buf, newcfg)
            if (!r.changes) {
                log("No changes.")
            } else {
                log("\nChanges:\n" + r.changes)
            }
            log("Downloading " + currUF2Name)
            download(r.patched, currUF2Name)
        }
    })
}