@simplelocalize/cli 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/index.cjs +10 -0
  2. package/package.json +4 -3
package/index.cjs CHANGED
@@ -77,6 +77,15 @@ async function installBinary(version = "2.8.0") {
77
77
  console.log('Binary is now executable.');
78
78
  }
79
79
 
80
+ const linkToNodeModulesBin = () => {
81
+ const nodeModulesBinPath = path.join(__dirname, '..', '.bin', 'simplelocalize');
82
+ if (fs.existsSync(nodeModulesBinPath)) {
83
+ fs.unlinkSync(nodeModulesBinPath);
84
+ }
85
+ fs.symlinkSync(binaryPath, nodeModulesBinPath);
86
+ console.log('Link to node_modules/.bin created.');
87
+ }
88
+
80
89
  const init = async () => {
81
90
  console.log("Checking if SimpleLocalize CLI is installed...");
82
91
  if (!isBinaryInstalled()) {
@@ -91,6 +100,7 @@ const init = async () => {
91
100
  console.log("SimpleLocalize CLI already installed.");
92
101
  }
93
102
  printBinaryVersion();
103
+ linkToNodeModulesBin();
94
104
  process.exit(0);
95
105
  }
96
106
 
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@simplelocalize/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "SimpleLocalize CLI for NPM",
5
5
  "main": "index.cjs",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "start": "node index.cjs"
8
+ "start": "node index.cjs",
9
+ "postinstall": "node index.cjs install"
9
10
  },
10
11
  "bin": {
11
- "simplelocalize": "./index.cjs"
12
+ "install": "index.cjs"
12
13
  },
13
14
  "dependencies": {
14
15
  "axios": "^1.8.3"