MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / resolveBundleDir

Function resolveBundleDir

src/lib/bundle.ts:310–324  ·  view source on GitHub ↗
(rawPath: string)

Source from the content-addressed store, hash-verified

308 * passes so a forged response never modifies the operator's filesystem.
309 */
310export function resolveBundleDir(rawPath: string): string {
311 if (typeof rawPath !== 'string' || rawPath.length === 0) {
312 throw ApiError.fromEnvelope({
313 error: {
314 code: 'VALIDATION_ERROR',
315 message: 'Invalid request.',
316 nextAction: 'Flag `--out` is invalid: must be a non-empty directory path.',
317 requestId: 'local',
318 details: { field: 'out', reason: 'must be a non-empty directory path' },
319 },
320 });
321 }
322 const trimmed = rawPath.endsWith('/') ? rawPath.slice(0, -1) : rawPath;
323 return isAbsolute(trimmed) ? trimmed : resolve(process.cwd(), trimmed);
324}
325
326/**
327 * Pick a code-file extension for `<dir>/code.<ext>` based on the §6.3

Callers 3

runArtifactGetFunction · 0.85
writeBundleFunction · 0.85
bundle.test.tsFile · 0.85

Calls 1

fromEnvelopeMethod · 0.80

Tested by

no test coverage detected