fix: support windows format path (#2262)
⯈using npx asc will transform the path from a\b to a\\b, so the entry path replace reg should be changed from /\\/g to /\\+/g
- [x] I've read the contributing guidelines
- [x] I've added my name and email to the NOTICE file
Wouldn't it be more correct to specify a\b on Windows, so in process.argv one gets a singly-escaped "a\\b"?
Wouldn't it be more correct to specify
a\bon Windows, so inprocess.argvone gets a singly-escaped"a\\b"?
It seems that npm do something in windows.
In windows when I use node .\node_modules\assemblyscript\bin\asc.js .\assembly\index.ts, I will got argv like ["C:\\Program Files\\nodejs\\node.exe","D:\\as\\node_modules\\assemblyscript\\bin\\asc.js",".\\assembly\\index.ts"]
but when I use npx asc .\assembly\index.ts, I will got argv like ["C:\\Program Files\\nodejs\\node.exe","D:\\as\\node_modules\\assemblyscript\\bin\\asc.js",".\\\\assembly\\\\index.ts"]
I find path.normalize can solve this issue and better readability than RegExp