mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 01:34:31 +00:00
refactor(media): share fileExists
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
DEFAULT_TIMEOUT_SECONDS,
|
||||
} from "./defaults.js";
|
||||
import { MediaUnderstandingSkipError } from "./errors.js";
|
||||
import { fileExists } from "./fs.js";
|
||||
import { extractGeminiResponse } from "./output-extract.js";
|
||||
import { describeImageWithModel } from "./providers/image.js";
|
||||
import { getMediaUnderstandingProvider, normalizeMediaProviderId } from "./providers/index.js";
|
||||
@@ -129,18 +130,6 @@ function resolveWhisperCppOutputPath(args: string[]): string | null {
|
||||
return `${outputBase}.txt`;
|
||||
}
|
||||
|
||||
async function fileExists(filePath?: string | null): Promise<boolean> {
|
||||
if (!filePath) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
await fs.stat(filePath);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function resolveCliOutput(params: {
|
||||
command: string;
|
||||
args: string[];
|
||||
|
||||
Reference in New Issue
Block a user