Open felipecrs opened 3 years ago
One approach that would solve this issue and #10136 would be by using https://github.com/kiennq/scoop-better-shimexe, as demonstrated here: https://github.com/npm/cli/issues/1189#issuecomment-817209410.
The contents of the file_server.shim
would be:
path = deno.exe
args = run --allow-read --allow-net https://deno.land/std@0.92.0/http/file_server.ts
To use it, we would need to bundle the shim.exe
in the deno.exe
binary (only for Windows). It is probably a reasonable approach as the shim.exe
binary itself has 123.5KB and it's MIT licensed.
Do powershell scripts support UNC paths? This seems like a cut-and-dry limitation of cmd, so offering something other than cmd is the only solution we should explore here IMO. cc @piscisaureus
Do powershell scripts support UNC paths?
Yes
> cd '\\wsl$\ubuntu\home\felipecrs\repos\megatar\'
Using pushd
instead of cd
should work.
Using
pushd
instead ofcd
should work.
@piscisaureus There isn't any problem with the cd
.
Using
pushd
instead ofcd
should work.
@piscisaureus It seems pushd
when used in powershell doesn't map a network drive and effectively aliases cd
:
I would suggest calling it from within our generated cmd file but I don't see a way of recovering the original UNC path.
@felipecrs You can tediously work around it by replacing:
> cd '\\wsl$\ubuntu\home\felipecrs\repos\megatar\'
> C:\Users\felip\.deno\bin\file_server.cmd
with:
> cmd.exe
> pushd '\\wsl$\ubuntu\home\felipecrs\repos\megatar\'
> C:\Users\felip\.deno\bin\file_server.cmd
@nayeemrmn I have no idea what you are talking about. Replace cd
with pushd
where?!
BTW this issue is still valid with Deno 1.44.4. Also worth mentioning that any UNC path is enough to trigger this issue, like browsing network directories.
Oh, I see now. Sorry. Yeah, that's very tedious indeed lol.
Note bun created a solution for this issue, they call it .bunx
:
https://bun.sh/blog/bun-v1.1#bun-run-on-windows
It would be awesome if Deno could leverage it.
References https://github.com/npm/cli/issues/1189 References https://github.com/volta-cli/volta/issues/966