fix: validate optional Python resources and isolate downloads

This commit is contained in:
yudshj committed 2026-10-09 15:52:59 +08:00
1 parent 305021fcd6
commit 4fd85be130
19 files changed
+335 -149

No files matched your search

+5 -2
View File
@@ -80,8 +80,11 @@ const aclRunner = process.platform === 'win32'
? fileURLToPath(import.meta.resolve('@deepseek-ai/dsh-sandbox-windows-acl/runner'))
: undefined
if (process.argv[2] === '--download-office' || process.argv[2] === '--download-primary-runtime') {
const path = await downloadResource(process.argv[2] === '--download-office' ? 'office' : 'primary')
const resource = process.env.DSH_RUNTIME_DOWNLOAD
if (resource !== undefined) {
Reflect.deleteProperty(process.env, 'DSH_RUNTIME_DOWNLOAD')
if (resource !== 'office' && resource !== 'primary') throw new Error('DSH_RUNTIME_DOWNLOAD must select office or primary')
const path = await downloadResource(resource)
console.log(JSON.stringify(path))
} else if (aclRunner !== undefined && process.argv[2] === aclRunner) {
process.argv.splice(1, 1)