move the fs tree into tree.ts
out of core.ts
This commit is contained in:
@ -11,22 +11,6 @@ const enum Permissions {
|
|||||||
type FsEntry = Entry<{}>
|
type FsEntry = Entry<{}>
|
||||||
type FsDirectory = Entry<FsEntry[]>
|
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
|
type File = string
|
||||||
interface Entry<T = File> {
|
interface Entry<T = File> {
|
||||||
readonly inner?: T,
|
readonly inner?: T,
|
||||||
@ -44,7 +28,6 @@ function Entry<T = File>(name: string, inner: T, permissions: Permissions): Entr
|
|||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
fs,
|
|
||||||
type FsDirectory,
|
type FsDirectory,
|
||||||
type FsEntry,
|
type FsEntry,
|
||||||
EntryType,
|
EntryType,
|
||||||
|
19
src/rt/shell/fs/tree.ts
Normal file
19
src/rt/shell/fs/tree.ts
Normal 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
|
Reference in New Issue
Block a user