mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
Create a wrapper script for npm package to fix npm install issues
This commit is contained in:
parent
14ecec1d4f
commit
53c8eaa4c2
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…
Reference in a new issue