@ast-grep/cli 0.4.1 → 0.5.1
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 +1 -1
- package/ast-grep +2 -0
- package/package.json +8 -6
- package/postinstall.js +3 -0
package/README.md
CHANGED
package/ast-grep
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ast-grep/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"sg",
|
|
13
|
+
"ast-grep",
|
|
13
14
|
"postinstall.js"
|
|
14
15
|
],
|
|
15
16
|
"dependencies": {
|
|
@@ -19,12 +20,13 @@
|
|
|
19
20
|
"postinstall": "node postinstall.js"
|
|
20
21
|
},
|
|
21
22
|
"optionalDependencies": {
|
|
22
|
-
"@ast-grep/cli-darwin-x64": "0.
|
|
23
|
-
"@ast-grep/cli-linux-x64-gnu": "0.
|
|
24
|
-
"@ast-grep/cli-win32-x64-msvc": "0.
|
|
25
|
-
"@ast-grep/cli-darwin-arm64": "0.
|
|
23
|
+
"@ast-grep/cli-darwin-x64": "0.5.1",
|
|
24
|
+
"@ast-grep/cli-linux-x64-gnu": "0.5.1",
|
|
25
|
+
"@ast-grep/cli-win32-x64-msvc": "0.5.1",
|
|
26
|
+
"@ast-grep/cli-darwin-arm64": "0.5.1"
|
|
26
27
|
},
|
|
27
28
|
"bin": {
|
|
28
|
-
"sg": "sg"
|
|
29
|
+
"sg": "sg",
|
|
30
|
+
"ast-grep": "ast-grep"
|
|
29
31
|
}
|
|
30
32
|
}
|
package/postinstall.js
CHANGED
|
@@ -16,6 +16,7 @@ if (process.platform === 'linux') {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
let binary = process.platform === 'win32' ? 'sg.exe' : 'sg';
|
|
19
|
+
let alternative = process.platform === 'win32' ? 'ast-grep.exe' : 'ast-grep';
|
|
19
20
|
|
|
20
21
|
let pkgPath;
|
|
21
22
|
try {
|
|
@@ -29,9 +30,11 @@ try {
|
|
|
29
30
|
|
|
30
31
|
try {
|
|
31
32
|
fs.linkSync(path.join(pkgPath, binary), path.join(__dirname, binary));
|
|
33
|
+
fs.linkSync(path.join(pkgPath, binary), path.join(__dirname, alternative));
|
|
32
34
|
} catch (err) {
|
|
33
35
|
try {
|
|
34
36
|
fs.copyFileSync(path.join(pkgPath, binary), path.join(__dirname, binary));
|
|
37
|
+
fs.copyFileSync(path.join(pkgPath, binary), path.join(__dirname, alternative));
|
|
35
38
|
} catch (err) {
|
|
36
39
|
console.error('Failed to move @ast-grep/cli binary into place.');
|
|
37
40
|
process.exit(1);
|