Skip to content

Commit

Permalink
fix(bin): support global usage on Windows
Browse files Browse the repository at this point in the history
- much wow such fun
  • Loading branch information
lukeed committed Oct 10, 2021
1 parent 4876242 commit 67600a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ if (argv.includes('-v') || argv.includes('--version')) {
process.exit(0);
}

argv = ['--loader', './loader.mjs', ...argv];
let { URL, pathToFileURL } = require('url') as typeof import('url');
argv = ['--loader', new URL('loader.mjs', pathToFileURL(__filename)).href, ...argv];
require('child_process').spawn('node', argv, { stdio: 'inherit' }).on('exit', process.exit);

0 comments on commit 67600a7

Please sign in to comment.