From 1010c6586ac95f71633d30d7ccdba78cdf46e91a Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 24 Sep 2025 21:13:09 -0700 Subject: [PATCH] updater --- app/nose/bin/update.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/nose/bin/update.ts 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