diff --git a/app/nose/bin/unshare.ts b/app/nose/bin/unshare.ts new file mode 100644 index 0000000..57fa553 --- /dev/null +++ b/app/nose/bin/unshare.ts @@ -0,0 +1,18 @@ +import { apps } from "app/src/webapp" +import { disconnectSneaker, sneakers } from "app/src/sneaker" + +export default async function (app: string) { + if (!app) { + return "usage: unshare " + } + + 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` +} \ No newline at end of file