fix: system command filtering

This commit is contained in:
Huakun Shen 2025-01-27 23:10:05 -05:00
parent b7b81013ba
commit 63bc401d8e
No known key found for this signature in database

View File

@ -371,8 +371,9 @@ export const rawSystemCommands = [
] ]
export function getSystemCommands(): SysCommand[] { export function getSystemCommands(): SysCommand[] {
const _platform = platform()
return rawSystemCommands return rawSystemCommands
.filter(async (cmd) => cmd.platforms.includes(platform())) // Filter out system commands that are not supported on the current platform .filter((cmd) => cmd.platforms.includes(_platform)) // Filter out system commands that are not supported on the current platform
.map((cmd) => ({ .map((cmd) => ({
name: cmd.name, name: cmd.name,
value: "system-cmd" + cmd.name.split(" ").join("-").toLowerCase(), value: "system-cmd" + cmd.name.split(" ").join("-").toLowerCase(),