Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
[![E2E Tests](https://github.com/codebtech/wp-feature-flags/actions/workflows/e2e.yml/badge.svg)](https://github.com/codebtech/wp-feature-flags/actions/workflows/e2e.yml)
[![codecov](https://codecov.io/github/codebtech/wp-feature-flags/graph/badge.svg?token=QNUWGCRJGR)](https://codecov.io/github/codebtech/wp-feature-flags)

Stable tag: 0.3.2
Requires at least: 6.2
Tested up to: 6.4
Requires PHP: 8.1

WordPress Feature flags plugin allow developers to configure features in plugins/themes behind the feature flags on both the server (PHP) and client (JS/TS) side.

## Installation
Expand Down
11 changes: 10 additions & 1 deletion scripts/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const package = require('../package.json');

const packagePath = path.join(process.cwd(), 'package.json');
const phpPath = path.join(process.cwd(), 'plugin.php');
const readmePath = path.join(process.cwd(), 'README.md');

const bumpTypes = ['patch', 'minor', 'major'];

Expand Down Expand Up @@ -51,13 +52,21 @@ const getNewVersion = () => {
2
);

const [php] = await Promise.all([fs.promises.readFile(phpPath, fsOpts)]);
const [php, readme] = await Promise.all([
fs.promises.readFile(phpPath, fsOpts),
fs.promises.readFile(readmePath, fsOpts),
]);

const newPHP = php.replace(new RegExp(previousVersion, 'g'), newVersion);
const newReadme = readme.replace(
new RegExp(previousVersion, 'g'),
newVersion
);

await Promise.all([
fs.promises.writeFile(packagePath, newPackage, fsOpts),
fs.promises.writeFile(phpPath, newPHP, fsOpts),
fs.promises.writeFile(readmePath, newReadme, fsOpts),
]);

// eslint-disable-next-line no-console
Expand Down