mini: fix default model (#35515)
This commit is contained in:
@@ -7,22 +7,10 @@ import { spawn } from "node:child_process"
|
||||
import type { Stream } from "node:stream"
|
||||
import { resolveZedDbPath, resolveZedSelection } from "./editor-zed"
|
||||
|
||||
export { normalizePromptContent } from "./prompt/content"
|
||||
|
||||
type EditorStdio = "inherit" | "pipe" | "ignore" | number | Stream
|
||||
|
||||
export function normalizePromptContent(content: string) {
|
||||
if (content.endsWith("\r\n")) {
|
||||
const body = content.slice(0, -2)
|
||||
return !body.includes("\n") && !body.includes("\r") ? body : content
|
||||
}
|
||||
|
||||
if (content.endsWith("\n")) {
|
||||
const body = content.slice(0, -1)
|
||||
return !body.includes("\n") && !body.includes("\r") ? body : content
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
export async function openEditor(input: { value: string; renderer: CliRenderer; cwd?: string; stdin?: EditorStdio }) {
|
||||
const editor = process.env.VISUAL || process.env.EDITOR
|
||||
if (!editor) return
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export function normalizePromptContent(content: string) {
|
||||
if (content.endsWith("\r\n")) {
|
||||
const body = content.slice(0, -2)
|
||||
return !body.includes("\n") && !body.includes("\r") ? body : content
|
||||
}
|
||||
|
||||
if (content.endsWith("\n")) {
|
||||
const body = content.slice(0, -1)
|
||||
return !body.includes("\n") && !body.includes("\r") ? body : content
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
Reference in New Issue
Block a user