mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-01 16:51:53 +03:00
fix(tui): enforce supported platform boundaries
This commit is contained in:
@@ -3,8 +3,15 @@ import { basename, join } from "node:path"
|
||||
|
||||
const target = process.argv[2] || `${process.platform}-${process.arch}`
|
||||
const [platform, arch] = target.split("-")
|
||||
const supportedTargets = new Set([
|
||||
"darwin-arm64",
|
||||
"darwin-x64",
|
||||
"linux-arm64",
|
||||
"linux-x64",
|
||||
"win32-x64",
|
||||
])
|
||||
|
||||
if (!platform || !arch || !["darwin", "linux", "win32"].includes(platform)) {
|
||||
if (!platform || !arch || !supportedTargets.has(target)) {
|
||||
throw new Error(`unsupported target: ${target}`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user