diff options
| author | 2023-04-28 01:36:44 +0800 | |
|---|---|---|
| committer | 2023-04-28 01:36:44 +0800 | |
| commit | dd84b9d64fb98746a230cd24233ff50a562c39c9 (patch) | |
| tree | b583261ef00b3afe72ec4d6dacb31e57779a6faf /cli/scripts/npm-native-packages/template/bin/turbo | |
| parent | 0b46fcd72ac34382387b2bcf9095233efbcc52f4 (diff) | |
| download | HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.tar.gz HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.zip | |
Diffstat (limited to 'cli/scripts/npm-native-packages/template/bin/turbo')
| -rw-r--r-- | cli/scripts/npm-native-packages/template/bin/turbo | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/scripts/npm-native-packages/template/bin/turbo b/cli/scripts/npm-native-packages/template/bin/turbo new file mode 100644 index 0000000..4557a07 --- /dev/null +++ b/cli/scripts/npm-native-packages/template/bin/turbo @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +// Unfortunately even though npm shims "bin" commands on Windows with auto- +// generated forwarding scripts, it doesn't strip the ".exe" from the file name +// first. So it's possible to publish executables via npm on all platforms +// except Windows. I consider this a npm bug. +// +// My workaround is to add this script as another layer of indirection. It'll +// be slower because node has to boot up just to shell out to the actual exe, +// but Windows is somewhat of a second-class platform to npm so it's the best +// I can do I think. +const path = require('path'); +const turbo_exe = path.join(__dirname, 'turbo.exe'); +const child_process = require('child_process'); +child_process.spawnSync(turbo_exe, process.argv.slice(2), { stdio: 'inherit' }); |
