Files
ruflo/v2/scripts/fix-shebang.js
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

78 lines
2.2 KiB
JavaScript

#!/usr/bin/env node
/**
* Script to fix shebang lines that got moved incorrectly
*/
import { promises as fs } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
async function fixShebangLine(filePath) {
try {
let content = await fs.readFile(filePath, 'utf-8');
let modified = false;
// Check if shebang is not at the start but exists in the file
if (!content.startsWith('#!') && content.includes('#!/usr/bin/env node')) {
// Find the shebang line
const lines = content.split('\n');
const shebangIndex = lines.findIndex(line => line.startsWith('#!/usr/bin/env node'));
if (shebangIndex > 0) {
// Remove the shebang from its current position
const shebangLine = lines[shebangIndex];
lines.splice(shebangIndex, 1);
// Add it to the beginning
lines.unshift(shebangLine);
content = lines.join('\n');
modified = true;
}
}
if (modified) {
await fs.writeFile(filePath, content);
console.log(`✅ Fixed shebang in: ${filePath}`);
}
} catch (error) {
console.error(`❌ Error processing ${filePath}:`, error.message);
}
}
async function findTypeScriptFiles(dir) {
const files = [];
const entries = await fs.readdir(dir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = join(dir, entry.name);
if (entry.isDirectory() && !entry.name.includes('node_modules') && !entry.name.includes('dist')) {
files.push(...await findTypeScriptFiles(fullPath));
} else if (entry.isFile() && entry.name.endsWith('.ts')) {
files.push(fullPath);
}
}
return files;
}
async function main() {
const srcDir = join(dirname(__dirname), 'src');
const files = await findTypeScriptFiles(srcDir);
console.log(`Found ${files.length} TypeScript files to check for shebang issues...`);
for (const file of files) {
await fixShebangLine(file);
}
console.log('✅ Shebang fixes complete!');
}
main().catch(console.error);