Commit e278301
committed
Add a windows launcher to the standalone release
The standalone release ships bin/code-server, a shell script that resolves
its own location and execs the bundled node against the release root. Windows
cannot run it, so a windows release arrives with no way to start it that does
not involve knowing where node ended up and typing both paths.
This adds the same launcher as a .cmd, copied into bin/ only when OS is
windows, so no other release changes at all. It is deliberately the shortest
thing that works: %~dp0 gives the bin directory, the root is one above it, and
the bundled node is handed the root and every argument.
Verified against a real windows release tree: --version answers, it works from
any working directory, and a bad flag comes back as exit code 1.
Two things a reviewer should know. The shell launcher resolves symlinks
before computing the root, because of #1537; the .cmd does not, since %~dp0
reports the directory of the link rather than of the target and batch has no
readlink. A copy of the file works anywhere, a symlink to it does not.
And the file is checked in with CRLF, which is what a .cmd is expected to have
on the platform it runs on and what a windows checkout would produce for it
anyway.1 parent 62284ed commit e278301
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments