28 lines
562 B
TypeScript
28 lines
562 B
TypeScript
////
|
|
// Runs a NOSE command in the NOSE environment
|
|
// Ex:
|
|
// $ bun runner greet Bob
|
|
// Hi, Bob!
|
|
|
|
import { runCommand } from "./shell"
|
|
|
|
const args = Bun.argv.slice(2)
|
|
|
|
if (!args.length) {
|
|
console.error("usage: runner <command> [args]")
|
|
process.exit(1)
|
|
}
|
|
|
|
const sessionId = ""
|
|
const taskId = ""
|
|
|
|
const result = await runCommand(sessionId, taskId, args.join(" "))
|
|
|
|
if (result.status === "ok")
|
|
console.log(result.output)
|
|
|
|
else if (result.status === "error")
|
|
console.error(result.output)
|
|
|
|
else
|
|
console.error("Unknown command result:", result) |