let { projects, write } = await db("projects", {
projects: [
"~/.kit",
"~/projects/kitapp",
"~/projects/scriptkit.com",
],
})
onTab("Open", async () => {
let project = await arg("Open project:", projects)
edit(project)
})
onTab("Add", async () => {
while (true) {
let project = await arg(
"Add path to project:",
md(projects.map(project => `* ${project}`).join("\n"))
)
projects.push(project)
await write()
}
})
onTab("Remove", async () => {
while (true) {
let project = await arg("Open project:", projects)
let indexOfProject = projects.indexOf(project)
projects.splice(indexOfProject, 1)
await write()
}
})