nose-pluto/bin/update.ts
2025-10-01 11:21:05 -07:00

19 lines
418 B
TypeScript

// Update NOSE itself and restart.
import { $ } from "bun"
import restart from "./restart"
export default async function () {
if (process.env.NODE_ENV !== "production") {
return { error: "Can only update in production." }
}
const { stdout } = await $`cd .. && git pull`.quiet()
const out = stdout.toString()
if (/up to date/.test(out)) {
return "Up to date."
} else {
return restart()
}
}