fix cwd loading, cat imgs
This commit is contained in:
parent
d3504d09f3
commit
bdb6fcdf05
|
|
@ -36,7 +36,7 @@ async function readFile(path: string): Promise<CommandOutput> {
|
||||||
switch (ext) {
|
switch (ext) {
|
||||||
case "jpeg": case "jpg": case "png": case "gif": case "webp":
|
case "jpeg": case "jpg": case "png": case "gif": case "webp":
|
||||||
const img = await file.arrayBuffer()
|
const img = await file.arrayBuffer()
|
||||||
return { html: `<img src="data:image/${ext};base64,${Buffer.from(img).toString('base64')}" />` }
|
return { html: `<img src="data:image/${ext};base64,${Buffer.from(img).toString('base64')}" style="max-height:270px;max-width:480px;" />` }
|
||||||
case "mp3": case "wav":
|
case "mp3": case "wav":
|
||||||
case "mp4": case "mov": case "avi": case "mkv": case "webm":
|
case "mp4": case "mov": case "avi": case "mkv": case "webm":
|
||||||
return "Not implemented"
|
return "Not implemented"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ export default function (project: string) {
|
||||||
|
|
||||||
if (state && apps().includes(project)) {
|
if (state && apps().includes(project)) {
|
||||||
state.project = project
|
state.project = project
|
||||||
|
state.cwd = ""
|
||||||
|
} else {
|
||||||
|
return { error: `failed to load ${project}` }
|
||||||
}
|
}
|
||||||
|
|
||||||
return state?.project ? `loaded ${project}` : { error: `failed to load ${project}` }
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user