mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-15 06:23:28 +08:00
Compare commits
2 Commits
d53f2516e7
...
9235d3d799
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9235d3d799 | ||
|
|
eeb86d8401 |
@@ -120,6 +120,22 @@ function normalizeComparablePath(targetPath) {
|
||||
return path.normalize(normalizedPath).replace(/\\/g, '/').replace(/^([a-z]):/, (_, drive) => `${drive.toUpperCase()}:`);
|
||||
}
|
||||
|
||||
function pathsReferToSameLocation(leftPath, rightPath) {
|
||||
const normalizedLeftPath = normalizeComparablePath(leftPath);
|
||||
const normalizedRightPath = normalizeComparablePath(rightPath);
|
||||
|
||||
if (!normalizedLeftPath || !normalizedRightPath) return false;
|
||||
if (normalizedLeftPath === normalizedRightPath) return true;
|
||||
|
||||
try {
|
||||
const leftStats = fs.statSync(normalizedLeftPath);
|
||||
const rightStats = fs.statSync(normalizedRightPath);
|
||||
return leftStats.dev === rightStats.dev && leftStats.ino === rightStats.ino;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function createCommandShim(binDir, baseName, logFile) {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
|
||||
@@ -2224,10 +2240,9 @@ async function runTests() {
|
||||
const normalizedMetadataRoot = normalizeComparablePath(metadata.root);
|
||||
const normalizedRepoDir = normalizeComparablePath(repoDir);
|
||||
assert.ok(normalizedMetadataRoot, 'project.json should include a non-empty repo root');
|
||||
assert.strictEqual(
|
||||
path.basename(normalizedMetadataRoot),
|
||||
path.basename(normalizedRepoDir),
|
||||
'project.json should include the repo root',
|
||||
assert.ok(
|
||||
pathsReferToSameLocation(normalizedMetadataRoot, normalizedRepoDir),
|
||||
`project.json should include the repo root (expected ${normalizedRepoDir}, got ${normalizedMetadataRoot})`,
|
||||
);
|
||||
assert.strictEqual(metadata.remote, 'https://github.com/example/ecc-test.git', 'project.json should include the sanitized remote');
|
||||
assert.ok(metadata.created_at, 'project.json should include created_at');
|
||||
|
||||
Reference in New Issue
Block a user