mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: add pwd handling to session and update related components
This commit is contained in:
1 parent
fba92dad46
commit
26e79690f8
7 files changed
+16
-4
No files matched your search
@@ -32,6 +32,13 @@ async function readOrNone(file) {
|
||||
|
||||
const commandListeners = {
|
||||
ls: [discoverFiles],
|
||||
cd: [changeDirectory],
|
||||
}
|
||||
|
||||
function changeDirectory() {
|
||||
return {
|
||||
pwd: process.cwd(),
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCommand(command) {
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface FileGraphUpdateEvent {
|
||||
add?: FileObject[]
|
||||
remove?: FileObject[]
|
||||
discover?: FileObject[]
|
||||
pwd?: string
|
||||
}
|
||||
|
||||
export default class FileGraph extends FileNode {
|
||||
|
||||
@@ -8,6 +8,7 @@ const fileSchema = z.object({
|
||||
|
||||
export const commandParamsSchema = z.object({
|
||||
discover: fileSchema.array().optional(),
|
||||
pwd: z.string().optional(),
|
||||
})
|
||||
|
||||
export type ICommandParams = z.infer<typeof commandParamsSchema>
|
||||
|
||||
Reference in new issue
Block a user