Skip to content

Commit c5dfcfd

Browse files
committed
Update versioning
1 parent 80e3423 commit c5dfcfd

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ in their workflows.
77
## Installation
88

99
```
10-
npm install @simplelocalize/[email protected].0-r1
10+
npm install @simplelocalize/[email protected].1
1111
```
1212

1313
After installing the package, it should automatically choose the right binary for
@@ -25,7 +25,7 @@ Package SimpleLocalize CLI in your project and makes it available in `package.js
2525
"version": "1.0.0",
2626
"private": true,
2727
"dependencies": {
28-
"@simplelocalize/cli": "^2.9.0-r1",
28+
"@simplelocalize/cli": "^2.9.1",
2929
},
3030
"scripts": {
3131
"start": "react-scripts start",
@@ -45,8 +45,8 @@ Learn more about [SimpleLocalize CLI commands](https://github.com/simplelocalize
4545
`@simplelocalize/cli@{CLI_VERSION}-release.{NPM_VERSION}` is the versioning scheme used in this package.
4646
Where `CLI_VERSION` is the version of SimpleLocalize CLI and `NPM_VERSION` is the version of this npm package.
4747

48-
`@simplelocalize/[email protected].0-r1` will install SimpleLocalize CLI 2.9.0 and this npm package version is 1.
49-
`@simplelocalize/[email protected].0-r2` will install SimpleLocalize CLI 2.9.0 and this npm package version is 2.
48+
`@simplelocalize/[email protected].1` will install SimpleLocalize CLI 2.9.x and this npm package version is 1.
49+
`@simplelocalize/[email protected].1` will install SimpleLocalize CLI 2.9.x and this npm package version is 2.
5050

5151
By using this versioning scheme, we can release new versions of this npm package
5252
without changing the SimpleLocalize CLI version, for example, to fix bugs in this package.

index.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ if (os.platform() === 'win32') {
1212

1313
const getExpectedCliVersion = () => {
1414
const packageVersion = require('./package.json').version;
15-
return packageVersion.split('+')[0];
15+
const parts = packageVersion.split('.');
16+
return parts[0] + '.' + parts[1] + '.0';
1617
};
1718

1819
const isBinaryInstalled = () => {
@@ -60,7 +61,7 @@ const buildDownloadBinaryUrl = (version) => {
6061

6162
async function installBinary() {
6263
const packageVersion = require('./package.json').version;
63-
const cliVersion = packageVersion.split('-')[0];
64+
const cliVersion = getExpectedCliVersion
6465
const downloadUrl = buildDownloadBinaryUrl(cliVersion);
6566
if (!fs.existsSync(path.join(__dirname, 'bin'))) {
6667
fs.mkdirSync(path.join(__dirname, 'bin'));
@@ -84,6 +85,11 @@ async function installBinary() {
8485
console.log('Making binary executable...');
8586
fs.chmodSync(binaryPath, 0o755);
8687
}
88+
89+
// Ensure binary exists and is executable before continuing
90+
if (!fs.existsSync(binaryPath)) {
91+
throw new Error('Binary file was not created!');
92+
}
8793
}
8894

8995
const linkToNodeModulesBin = () => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@simplelocalize/cli",
3-
"version": "2.9.0-r1",
3+
"version": "2.9.1",
44
"description": "SimpleLocalize CLI for NPM",
55
"main": "index.cjs",
66
"type": "module",

0 commit comments

Comments
 (0)