MCPcopy
hub / github.com/garrytan/gstack / isSymlinkLoop

Function isSymlinkLoop

test/gen-skill-docs.test.ts:1679–1684  ·  view source on GitHub ↗
(codexName: string)

Source from the content-addressed store, hash-verified

1677 const CODEX_SKILLS = (() => {
1678 const skills: Array<{ dir: string; codexName: string }> = [];
1679 const isSymlinkLoop = (codexName: string): boolean => {
1680 const agentSkillDir = path.join(ROOT, '.agents', 'skills', codexName);
1681 try {
1682 return fs.realpathSync(agentSkillDir) === fs.realpathSync(ROOT);
1683 } catch { return false; }
1684 };
1685 if (fs.existsSync(path.join(ROOT, 'SKILL.md.tmpl'))) {
1686 if (!isSymlinkLoop('gstack')) {
1687 skills.push({ dir: '.', codexName: 'gstack' });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected