Create a wrapper script for npm package to fix npm install issues
This commit is contained in:
parent
14ecec1d4f
commit
53c8eaa4c2
3 changed files with 14 additions and 1 deletions
1
cli/npm/.gitignore
vendored
1
cli/npm/.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
tree-sitter
|
||||
tree-sitter.exe
|
||||
*.gz
|
||||
*.tgz
|
||||
|
|
|
|||
12
cli/npm/cli.js
Executable file
12
cli/npm/cli.js
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const path = require('path');
|
||||
const spawn = require("child_process").spawn;
|
||||
const executable = process.platform === 'win32'
|
||||
? 'tree-sitter.exe'
|
||||
: 'tree-sitter';
|
||||
spawn(
|
||||
path.join(__dirname, executable),
|
||||
process.argv.slice(2),
|
||||
{stdio: 'inherit'}
|
||||
).on('close', process.exit)
|
||||
|
|
@ -17,6 +17,6 @@
|
|||
"install": "node install.js"
|
||||
},
|
||||
"bin": {
|
||||
"tree-sitter": "tree-sitter"
|
||||
"tree-sitter": "cli.js"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue