move the fs tree into tree.ts out of core.ts

This commit is contained in:
2025-02-25 21:13:08 -05:00
parent db31f20d24
commit 4f3df58ff4
2 changed files with 19 additions and 17 deletions

View File

@ -11,22 +11,6 @@ const enum Permissions {
type FsEntry = Entry<{}>
type FsDirectory = Entry<FsEntry[]>
const user = [
Entry("about_me.txt", "about me inside", Permissions.rw),
Entry("services.txt", "services inside", Permissions.rw),
Entry("hi", [], Permissions.rw)
]
const home = [
Entry("user", user, Permissions.rw)
]
const root = [
Entry("home", home, Permissions.r),
Entry("bin", {}, Permissions.r),
]
const fs = [
Entry("/", root, Permissions.r)
]
type File = string
interface Entry<T = File> {
readonly inner?: T,
@ -44,7 +28,6 @@ function Entry<T = File>(name: string, inner: T, permissions: Permissions): Entr
}
export {
fs,
type FsDirectory,
type FsEntry,
EntryType,

19
src/rt/shell/fs/tree.ts Normal file
View File

@ -0,0 +1,19 @@
import { Entry, Permissions } from "./core"
const user = [
Entry("about_me.txt", "about me inside", Permissions.rw),
Entry("services.txt", "services inside", Permissions.rw),
Entry("hi", [], Permissions.rw)
]
const home = [
Entry("user", user, Permissions.rw)
]
const root = [
Entry("home", home, Permissions.r),
Entry("bin", {}, Permissions.r),
]
const fstree = [
Entry("/", root, Permissions.r)
]
export default fstree