nose-pluto/app/nose/bin/unshare.ts

20 lines
490 B
TypeScript

// Stop sharing a webapp with the public internet.
import { apps } from "app/src/webapp"
import { disconnectSneaker, sneakers } from "app/src/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`
}