@simplelocalize/cli 2.9.0-r1 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.cjs +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ in their workflows.
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
npm install @simplelocalize/cli@2.9.
|
|
10
|
+
npm install @simplelocalize/cli@2.9.1
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
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
|
|
|
25
25
|
"version": "1.0.0",
|
|
26
26
|
"private": true,
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@simplelocalize/cli": "^2.9.
|
|
28
|
+
"@simplelocalize/cli": "^2.9.1",
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"start": "react-scripts start",
|
|
@@ -45,8 +45,8 @@ Learn more about [SimpleLocalize CLI commands](https://github.com/simplelocalize
|
|
|
45
45
|
`@simplelocalize/cli@{CLI_VERSION}-release.{NPM_VERSION}` is the versioning scheme used in this package.
|
|
46
46
|
Where `CLI_VERSION` is the version of SimpleLocalize CLI and `NPM_VERSION` is the version of this npm package.
|
|
47
47
|
|
|
48
|
-
`@simplelocalize/cli@2.9.
|
|
49
|
-
`@simplelocalize/cli@2.9.
|
|
48
|
+
`@simplelocalize/cli@2.9.1` will install SimpleLocalize CLI 2.9.x and this npm package version is 1.
|
|
49
|
+
`@simplelocalize/cli@2.9.1` will install SimpleLocalize CLI 2.9.x and this npm package version is 2.
|
|
50
50
|
|
|
51
51
|
By using this versioning scheme, we can release new versions of this npm package
|
|
52
52
|
without changing the SimpleLocalize CLI version, for example, to fix bugs in this package.
|
package/index.cjs
CHANGED
|
@@ -12,7 +12,8 @@ if (os.platform() === 'win32') {
|
|
|
12
12
|
|
|
13
13
|
const getExpectedCliVersion = () => {
|
|
14
14
|
const packageVersion = require('./package.json').version;
|
|
15
|
-
|
|
15
|
+
const parts = packageVersion.split('.');
|
|
16
|
+
return parts[0] + '.' + parts[1] + '.0';
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
const isBinaryInstalled = () => {
|
|
@@ -60,7 +61,7 @@ const buildDownloadBinaryUrl = (version) => {
|
|
|
60
61
|
|
|
61
62
|
async function installBinary() {
|
|
62
63
|
const packageVersion = require('./package.json').version;
|
|
63
|
-
const cliVersion =
|
|
64
|
+
const cliVersion = getExpectedCliVersion
|
|
64
65
|
const downloadUrl = buildDownloadBinaryUrl(cliVersion);
|
|
65
66
|
if (!fs.existsSync(path.join(__dirname, 'bin'))) {
|
|
66
67
|
fs.mkdirSync(path.join(__dirname, 'bin'));
|
|
@@ -84,6 +85,11 @@ async function installBinary() {
|
|
|
84
85
|
console.log('Making binary executable...');
|
|
85
86
|
fs.chmodSync(binaryPath, 0o755);
|
|
86
87
|
}
|
|
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
|
+
}
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
const linkToNodeModulesBin = () => {
|