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