Compare commits
No commits in common. "384a0bd111e80ee5fdfc7601101027022a8aab7a" and "682d53fb35ce5fb6d9e692281848efc9b4756cfe" have entirely different histories.
384a0bd111
...
682d53fb35
|
|
@ -1,13 +1,13 @@
|
||||||
// Load a project so you can work on it.
|
// Load a project so you can work on it.
|
||||||
|
|
||||||
import { projects } from "@/project"
|
import { apps } from "@/webapp"
|
||||||
import { sessionGet, sessionSet } from "@/session"
|
import { sessionGet, sessionSet } from "@/session"
|
||||||
|
|
||||||
export default function (project: string) {
|
export default function (project: string) {
|
||||||
const state = sessionGet()
|
const state = sessionGet()
|
||||||
if (!project) throw `usage: load <project name>`
|
if (!project) throw `usage: load <project name>`
|
||||||
|
|
||||||
if (state && projects().includes(project)) {
|
if (state && apps().includes(project)) {
|
||||||
sessionSet("project", project)
|
sessionSet("project", project)
|
||||||
sessionSet("cwd", "")
|
sessionSet("cwd", "")
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export default function (project: string) {
|
||||||
|
|
||||||
if (projects().includes(project)) throw `${project} already exists`
|
if (projects().includes(project)) throw `${project} already exists`
|
||||||
|
|
||||||
const dir = join(NOSE_DIR, project)
|
const dir = join(NOSE_DIR, project, "bin")
|
||||||
mkdirSync(dir, { recursive: true })
|
mkdirSync(dir, { recursive: true })
|
||||||
writeFileSync(join(dir, `index.ts`), `export default (c: Context) =>\n "Hello, world!"`)
|
writeFileSync(join(dir, `index.ts`), `export default (c: Context) =>\n "Hello, world!"`)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user