diff --git a/app/nose/bin/update.ts b/app/nose/bin/update.ts new file mode 100644 index 0000000..1143226 --- /dev/null +++ b/app/nose/bin/update.ts @@ -0,0 +1,12 @@ +import { $ } from "bun" + +export default async function () { + const { stdout } = await $`cd .. && git pull`.quiet() + const out = stdout.toString() + if (/up to date/.test(out)) { + return "Up to date." + } else { + setTimeout(() => process.exit(), 1000) + return "Restarting in 1 second..." + } +} \ No newline at end of file