mirror of
https://github.com/yamadashy/repomix.git
synced 2026-05-30 11:18:53 +02:00
72b75f607b
intent(tmp-dir): a single grep should find every consumer of the `$TMPDIR/repomix/` umbrella; previously the path was rebuilt independently in mcpToolRuntime and tokenCountCache, with no shared anchor preventing future drift decision(api-shape): expose only `getRepomixTmpDir()` + the `REPOMIX_TMP_DIR_NAME` constant — callers append their own subdirectory (`mcp-outputs`, `cache`) and own their mkdir/mkdtemp/permissions, since each consumer's lifecycle and creation pattern differs rejected(scope): folding `--remote`'s `mkdtemp(repomix-)` into the umbrella was considered but skipped — it uses a different prefix-based scheme at the $TMPDIR root, not the shared umbrella, and changing it is a user-visible path change worth handling separately
14 lines
509 B
TypeScript
14 lines
509 B
TypeScript
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { getRepomixTmpDir, REPOMIX_TMP_DIR_NAME } from '../../src/shared/tmpDir.js';
|
|
|
|
describe('shared/tmpDir', () => {
|
|
it('returns a path under os.tmpdir() ending with the umbrella name', () => {
|
|
const dir = getRepomixTmpDir();
|
|
expect(dir.startsWith(os.tmpdir())).toBe(true);
|
|
expect(path.basename(dir)).toBe(REPOMIX_TMP_DIR_NAME);
|
|
expect(REPOMIX_TMP_DIR_NAME).toBe('repomix');
|
|
});
|
|
});
|