mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 22:28:10 +09:00
checkpoint: File edit:
🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
1 parent
8eb6762763
commit
fc641ba455
1 file changed
+31
@@ -416,7 +416,38 @@ async function writeHelpers(
|
||||
result: InitResult
|
||||
): Promise<void> {
|
||||
const helpersDir = path.join(targetDir, '.claude', 'helpers');
|
||||
const sourceBaseDir = options.sourceBaseDir;
|
||||
|
||||
// Try to copy existing helpers from source first
|
||||
if (sourceBaseDir) {
|
||||
const sourceHelpersDir = path.join(sourceBaseDir, '.claude', 'helpers');
|
||||
if (fs.existsSync(sourceHelpersDir)) {
|
||||
const helperFiles = fs.readdirSync(sourceHelpersDir);
|
||||
for (const file of helperFiles) {
|
||||
const sourcePath = path.join(sourceHelpersDir, file);
|
||||
const destPath = path.join(helpersDir, file);
|
||||
|
||||
// Skip directories and only copy files
|
||||
if (!fs.statSync(sourcePath).isFile()) continue;
|
||||
|
||||
if (!fs.existsSync(destPath) || options.force) {
|
||||
fs.copyFileSync(sourcePath, destPath);
|
||||
|
||||
// Make shell scripts executable
|
||||
if (file.endsWith('.sh')) {
|
||||
fs.chmodSync(destPath, '755');
|
||||
}
|
||||
|
||||
result.created.files.push(`.claude/helpers/${file}`);
|
||||
} else {
|
||||
result.skipped.push(`.claude/helpers/${file}`);
|
||||
}
|
||||
}
|
||||
return; // Skip generating if we copied from source
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to generating helpers if source not available
|
||||
const helpers: Record<string, string> = {
|
||||
'pre-commit': generatePreCommitHook(),
|
||||
'post-commit': generatePostCommitHook(),
|
||||
|
||||
Reference in new issue
Block a user