feat(update): integrate official site update flow

This commit is contained in:
晴天
2026-06-06 13:59:52 +08:00
parent 38934fe754
commit f340b64028
35 changed files with 4074 additions and 2230 deletions

View File

@@ -6,6 +6,7 @@ import path from 'node:path'
import {
buildOpenclawPathConflictRecords,
resolveOpenclawCliInput,
quarantineOpenclawPathForWeb,
readJsonFileRelaxed,
} from '../scripts/dev-api.js'
@@ -93,3 +94,22 @@ test('Web API CLI 隔离拒绝非 openclaw 文件', () => {
fs.rmSync(tmp, { recursive: true, force: true })
}
})
test('Web API Windows CLI 解析不会绑定无扩展名 openclaw shim', (t) => {
if (process.platform !== 'win32') {
t.skip('Windows only')
return
}
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'clawpanel-cli-shim-'))
try {
const bare = path.join(tmp, 'openclaw')
fs.writeFileSync(bare, '#!/bin/sh\n')
assert.equal(resolveOpenclawCliInput(bare), null)
const cmd = path.join(tmp, 'openclaw.cmd')
fs.writeFileSync(cmd, '@echo off\r\n')
assert.equal(resolveOpenclawCliInput(bare), cmd)
} finally {
fs.rmSync(tmp, { recursive: true, force: true })
}
})