Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bump version script #19

Open
ChaiyoKung opened this issue Feb 28, 2024 · 0 comments
Open

Add bump version script #19

ChaiyoKung opened this issue Feb 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ChaiyoKung
Copy link
Owner

Add bump version script something like this

file: bump-version.js

const fs = require('fs');

const packageJsonPath = 'package.json';

// Read package.json
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));

// Bump the version (custom logic)
const versionParts = packageJson.version.split('.');
versionParts[2] = parseInt(versionParts[2]) + 1; // Incrementing patch version

// Update package.json with the new version
packageJson.version = versionParts.join('.');
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));

console.log(`Bumped version to ${packageJson.version}`);

and modified README.md to up to date

@ChaiyoKung ChaiyoKung added the enhancement New feature or request label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant