FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-server/src/node/entry.ts at v3.11.1 · coder/code-server · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
coder
/
code-server
Public
Notifications
You must be signed in to change notification settings
Fork
6.8k
Star
79.1k
Code
Issues
143
Pull requests
7
Discussions
Actions
Projects
Security and quality
1
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-server
/
src
/
node
/
entry.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
75 lines (66 loc) · 2.01 KB
Breadcrumbs
code-server
/
src
/
node
/
entry.ts
Copy path
File metadata and controls
75 lines (66 loc) · 2.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import
{
logger
}
from
"@coder/logger"
import
{
optionDescriptions
,
parse
,
readConfigFile
,
setDefaults
,
shouldOpenInExistingInstance
,
shouldRunVsCodeCli
,
}
from
"./cli"
import
{
commit
,
version
}
from
"./constants"
import
{
openInExistingInstance
,
runCodeServer
,
runVsCodeCli
}
from
"./main"
import
*
as
proxyAgent
from
"./proxy_agent"
import
{
isChild
,
wrapper
}
from
"./wrapper"
async
function
entry
(
)
:
Promise
<
void
>
{
proxyAgent
.
monkeyPatch
(
false
)
// There's no need to check flags like --help or to spawn in an existing
// instance for the child process because these would have already happened in
// the parent and the child wouldn't have been spawned. We also get the
// arguments from the parent so we don't have to parse twice and to account
// for environment manipulation (like how PASSWORD gets removed to avoid
// leaking to child processes).
if
(
isChild
(
wrapper
)
)
{
const
args
=
await
wrapper
.
handshake
(
)
wrapper
.
preventExit
(
)
await
runCodeServer
(
args
)
return
}
const
cliArgs
=
parse
(
process
.
argv
.
slice
(
2
)
)
const
configArgs
=
await
readConfigFile
(
cliArgs
.
config
)
const
args
=
await
setDefaults
(
cliArgs
,
configArgs
)
if
(
args
.
help
)
{
console
.
log
(
"code-server"
,
version
,
commit
)
console
.
log
(
""
)
console
.
log
(
`Usage: code-server [options] [path]`
)
console
.
log
(
""
)
console
.
log
(
"Options"
)
optionDescriptions
(
)
.
forEach
(
(
description
)
=>
{
console
.
log
(
""
,
description
)
}
)
return
}
if
(
args
.
version
)
{
if
(
args
.
json
)
{
console
.
log
(
{
codeServer
:
version
,
commit
,
vscode
:
require
(
"../../lib/vscode/package.json"
)
.
version
,
}
)
}
else
{
console
.
log
(
version
,
commit
)
}
return
}
if
(
shouldRunVsCodeCli
(
args
)
)
{
return
runVsCodeCli
(
args
)
}
const
socketPath
=
await
shouldOpenInExistingInstance
(
cliArgs
)
if
(
socketPath
)
{
return
openInExistingInstance
(
args
,
socketPath
)
}
return
wrapper
.
start
(
args
)
}
entry
(
)
.
catch
(
(
error
)
=>
{
logger
.
error
(
error
.
message
)
wrapper
.
exit
(
error
)
}
)
Back
|
FazBrowse Home
|
New Git URL