MCPcopy Index your code
hub / github.com/simstudioai/sim / withTempDir

Function withTempDir

apps/sim/lib/media/ffmpeg.ts:189–197  ·  view source on GitHub ↗
(fn: (dir: string) => Promise<T>)

Source from the content-addressed store, hash-verified

187}
188
189async function withTempDir<T>(fn: (dir: string) => Promise<T>): Promise<T> {
190 ensureFfmpeg()
191 const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'media-ffmpeg-'))
192 try {
193 return await fn(dir)
194 } finally {
195 await fs.rm(dir, { recursive: true, force: true }).catch(() => {})
196 }
197}
198
199async function writeInput(dir: string, file: MediaFile, index: number): Promise<string> {
200 const ext = extFromMime(file.mimeType)

Callers 2

probeMediaFunction · 0.85
runFfmpegOperationFunction · 0.85

Calls 3

joinMethod · 0.80
ensureFfmpegFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected