nose-pluto/bin/unshare.ts
Chris Wanstrath 3ec5b8d1e5 wip
2025-10-10 14:57:48 -07:00

20 lines
485 B
TypeScript

// Stop sharing a webapp with the public internet.
import { apps } from "@/webapp/server"
import { disconnectSneaker, sneakers } from "@/sneaker"
export default async function (app: string) {
if (!app) {
return "usage: unshare <app>"
}
if (!apps().includes(app)) {
return { error: `${app} not found` }
}
if (!sneakers().includes(app)) {
return { error: `${app} not shared` }
}
return (await disconnectSneaker(app)) ? "unshared" : `${app} wasn't shared`
}