Compare commits
No commits in common. "7aa64cfdaaefea64dcdd85cba9022830da98c1ca" and "00e035c853d22184521af3245b3ae50d5a7868be" have entirely different histories.
7aa64cfdaa
...
00e035c853
|
|
@ -4,7 +4,6 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"runner": "bun run src/runner.ts",
|
|
||||||
"start": "bun src/server.tsx",
|
"start": "bun src/server.tsx",
|
||||||
"prod": "env NODE_ENV=production bun src/server.tsx",
|
"prod": "env NODE_ENV=production bun src/server.tsx",
|
||||||
"dev": "env BUN_HOT=1 bun --hot src/server.tsx",
|
"dev": "env BUN_HOT=1 bun --hot src/server.tsx",
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,5 @@ ROOT_DIR="$SCRIPT_DIR/../.."
|
||||||
# Run deploy + config with absolute paths
|
# Run deploy + config with absolute paths
|
||||||
source "$ROOT_DIR/app/scripts/config.sh"
|
source "$ROOT_DIR/app/scripts/config.sh"
|
||||||
|
|
||||||
# Make sure we're up-to-date
|
|
||||||
git push origin main
|
|
||||||
git push gitea main
|
|
||||||
|
|
||||||
# Run remote install on the target
|
# Run remote install on the target
|
||||||
ssh $HOST "cd $DEST && bun runner update"
|
ssh $HOST "cd $DEST && git pull && bun install && sudo systemctl restart nose-pluto.service"
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
////
|
|
||||||
// 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)
|
|
||||||
|
|
@ -11,7 +11,7 @@ import { ALS } from "./session"
|
||||||
|
|
||||||
const sessions: Map<string, Session> = new Map()
|
const sessions: Map<string, Session> = new Map()
|
||||||
|
|
||||||
export async function runCommand(sessionId: string, taskId: string, input: string): Promise<CommandResult> {
|
export async function runCommand(session: string, id: string, input: string): Promise<CommandResult> {
|
||||||
const [cmd = "", ...args] = input.split(" ")
|
const [cmd = "", ...args] = input.split(" ")
|
||||||
|
|
||||||
if (!commandExists(cmd)) {
|
if (!commandExists(cmd)) {
|
||||||
|
|
@ -20,7 +20,7 @@ export async function runCommand(sessionId: string, taskId: string, input: strin
|
||||||
|
|
||||||
let status: "ok" | "error" = "ok"
|
let status: "ok" | "error" = "ok"
|
||||||
let output: CommandOutput = ""
|
let output: CommandOutput = ""
|
||||||
const state = getState(sessionId, taskId)
|
const state = getState(session, id)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[status, output] = await ALS.run(state, async () => await exec(cmd, args))
|
[status, output] = await ALS.run(state, async () => await exec(cmd, args))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user