29 lines
914 B
JavaScript
29 lines
914 B
JavaScript
const fs = require('fs')
|
|
const p = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/renderer/src/App.tsx'
|
|
let c = fs.readFileSync(p, 'utf8')
|
|
|
|
function rep(from, to) {
|
|
if (!c.includes(from)) {
|
|
console.log('MISS ::', from.slice(0, 70).replace(/\n/g, '\\n'))
|
|
return
|
|
}
|
|
c = c.replace(from, to)
|
|
}
|
|
|
|
rep(
|
|
` if (!skin.avatar.calibration) {
|
|
window.setTimeout(() => adapterRef.current?.tryAutoCalibrate?.(), 700)
|
|
}`,
|
|
` {
|
|
const calAny = skin.avatar.calibration as { v?: number } | undefined
|
|
const imported = (skin as { flavor?: string }).flavor === 'normal'
|
|
const needCal = !calAny || (imported && (calAny.v ?? 0) < 2)
|
|
if (needCal) {
|
|
window.setTimeout(() => adapterRef.current?.tryAutoCalibrate?.(), 900)
|
|
}
|
|
}`
|
|
)
|
|
|
|
fs.writeFileSync(p, c, 'utf8')
|
|
console.log('cal trigger patched')
|