Files
ruflo/scripts/update-bin-version.js
T
rUvandClaude a7d99b86d3 fix: ensure proper binary builds for alpha releases (#191)
- Fixed prepublishOnly script to run build process for alpha releases
- Added update-version script to automatically sync VERSION in bin/claude-flow
- Added version update step to build process

This ensures that all published alpha versions will have the correct version
number in the binary, fixing the issue where alpha.28-37 were stuck at v2.0.0-alpha.27

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 19:39:06 +00:00

32 lines
847 B
JavaScript

#!/usr/bin/env node
/**
* Updates the VERSION in bin/claude-flow shell script to match package.json
*/
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Read package.json
const packagePath = path.join(__dirname, '..', 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
const version = packageJson.version;
// Read bin/claude-flow
const binPath = path.join(__dirname, '..', 'bin', 'claude-flow');
let binContent = fs.readFileSync(binPath, 'utf8');
// Update VERSION line
binContent = binContent.replace(
/^VERSION=".*"$/m,
`VERSION="${version}"`
);
// Write back
fs.writeFileSync(binPath, binContent);
console.log(`✅ Updated bin/claude-flow VERSION to ${version}`);