MCPcopy Create free account
hub / github.com/SethGammon/Citadel / copyDirRecursive

Function copyDirRecursive

hooks_src/init-project.js:68–79  ·  view source on GitHub ↗
(src, dest)

Source from the content-addressed store, hash-verified

66}
67
68function shouldSyncScripts() {
69 try {
70 const pkgPath = path.join(PLUGIN_ROOT, 'package.json');
71 if (!fs.existsSync(pkgPath)) return true; // can't determine — sync to be safe
72 const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
73 const pluginVersion = pkg.version || '0.0.0';
74
75 const versionFile = path.join(PROJECT_ROOT, '.citadel', 'version.txt');
76 if (!fs.existsSync(versionFile)) return true;
77
78 const installedVersion = fs.readFileSync(versionFile, 'utf8').trim();
79 if (installedVersion !== pluginVersion) return true;
80
81 const pluginScripts = path.join(PLUGIN_ROOT, 'scripts');
82 const projectScripts = path.join(PROJECT_ROOT, '.citadel', 'scripts');

Callers 1

mainFunction · 0.85

Calls 1

ensureDirFunction · 0.70

Tested by

no test coverage detected