mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-25 03:34:22 +01:00
temporarily remove bun strip ansi due to bug
This commit is contained in:
@@ -2,7 +2,6 @@ import type { Argv } from "yargs"
|
||||
import { Session } from "../../session"
|
||||
import { cmd } from "./cmd"
|
||||
import { bootstrap } from "../bootstrap"
|
||||
import { UI } from "../ui"
|
||||
import { Storage } from "../../storage/storage"
|
||||
import { Instance } from "../../project/instance"
|
||||
import { EOL } from "os"
|
||||
@@ -19,20 +18,19 @@ export const ImportCommand = cmd({
|
||||
},
|
||||
handler: async (args) => {
|
||||
await bootstrap(process.cwd(), async () => {
|
||||
const file = Bun.file(args.file as string)
|
||||
const exists = await file.exists()
|
||||
if (!exists) {
|
||||
UI.error(`File not found: ${args.file}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const exportData = (await file.json()) as {
|
||||
const file = Bun.file(args.file)
|
||||
const exportData = (await file.json().catch(() => {})) as {
|
||||
info: Session.Info
|
||||
messages: Array<{
|
||||
info: any
|
||||
parts: any[]
|
||||
}>
|
||||
}
|
||||
if (!exportData) {
|
||||
process.stdout.write(`File not found: ${args.file}`)
|
||||
process.stdout.write(EOL)
|
||||
return
|
||||
}
|
||||
|
||||
await Storage.write(["session", Instance.project.id, exportData.info.id], exportData.info)
|
||||
|
||||
|
||||
@@ -1171,7 +1171,7 @@ ToolRegistry.register<typeof BashTool>({
|
||||
name: "bash",
|
||||
container: "block",
|
||||
render(props) {
|
||||
const output = createMemo(() => Bun.stripANSI(props.metadata.output?.trim() ?? ""))
|
||||
const output = createMemo(() => props.metadata.output?.trim() ?? "")
|
||||
const { theme } = useTheme()
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user