Skip to content

Commit

Permalink
fix: Add lefthook npm package executable
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox committed Jun 25, 2022
1 parent 840d913 commit 3890242
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ packaging/rubygems/libexec/
packaging/npm-bundled/bin/
packaging/npm-*/README.md
packaging/npm/*/bin/
!packaging/npm/lefthook/bin/index.js
packaging/npm/*/README.md
package.json
!packaging/npm/*/package.json
Expand Down
2 changes: 1 addition & 1 deletion packaging/npm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ put-readme:

clean:
find . -name 'README.md' -exec rm \{} \;
find . -type f -executable -exec rm \{} \;
find . -type f -name 'lefthook*' -executable -exec rm \{} \;
17 changes: 17 additions & 0 deletions packaging/npm/lefthook/bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

var spawn = require('child_process').spawn;
const { getExePath } = require('../get-exe');

var command_args = process.argv.slice(2);

var child = spawn(
getExePath(),
command_args,
{ stdio: "inherit" });

child.on('close', function (code) {
if (code !== 0) {
process.exit(1);
}
});

0 comments on commit 3890242

Please sign in to comment.