////
// Keep track of all NOSE commands.

import type { Commands } from "../shared/types"
import { runCommand } from "./shell"

export const commands: Commands = {}

export function cacheCommands(cmds: Commands) {
  for (const key in commands)
    delete commands[key]

  Object.assign(commands, cmds)
}

export async function mode(mode?: string) {
  await runCommand(mode ? `mode ${mode}` : "mode", false)
}