FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-oss/scripts/code.sh at code-oss-esm · unlicense-code/code-oss · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
unlicense-code
/
code-oss
Public
forked from
lemanschik/code-oss
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-oss
/
scripts
/
code.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
93 lines (80 loc) · 2.69 KB
Breadcrumbs
code-oss
/
scripts
/
code.sh
Copy path
File metadata and controls
executable file
·
93 lines (80 loc) · 2.69 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!
/usr/bin/env bash
set
-e
if
[[
"
$OSTYPE
"
==
"
darwin
"
*
]]
;
then
realpath
() { [[
$1
=
/
*
]]
&&
echo
"
$1
"
||
echo
"
$PWD
/
${1
#
.
/
}
"
;
}
ROOT=
$(
dirname
"
$(
dirname
"
$(
realpath
"
$0
"
)
"
)
"
)
else
ROOT=
$(
dirname
"
$(
dirname
"
$(
readlink -f
$0
)
"
)
"
)
#
If the script is running in Docker using the WSL2 engine, powershell.exe won't exist
if
grep -qi Microsoft /proc/version
&&
type
powershell.exe
>
/dev/null
2>&1
;
then
IN_WSL=true
fi
fi
function
code()
{
cd
"
$ROOT
"
if
[[
"
$OSTYPE
"
==
"
darwin
"
*
]]
;
then
NAME=
`
node -p
"
require('./product.json').nameLong
"
`
CODE=
"
./.build/electron/
$NAME
.app/Contents/MacOS/Electron
"
else
NAME=
`
node -p
"
require('./product.json').applicationName
"
`
CODE=
"
.build/electron/
$NAME
"
fi
#
Get electron, compile, built-in extensions
if
[[
-z
"
${VSCODE_SKIP_PRELAUNCH}
"
]]
;
then
node build/lib/preLaunch.js
fi
#
Manage built-in extensions
if
[[
"
$1
"
==
"
--builtin
"
]]
;
then
exec
"
$CODE
"
build/builtin
return
fi
#
Configuration
export
NODE_ENV=development
export
VSCODE_DEV=1
export
VSCODE_CLI=1
export
ELECTRON_ENABLE_STACK_DUMPING=1
export
ELECTRON_ENABLE_LOGGING=1
DISABLE_TEST_EXTENSION=
"
--disable-extension=vscode.vscode-api-tests
"
if
[[
"
$@
"
==
*
"
--extensionTestsPath
"
*
]]
;
then
DISABLE_TEST_EXTENSION=
"
"
fi
#
Launch Code
exec
"
$CODE
"
.
$DISABLE_TEST_EXTENSION
"
$@
"
}
function
code-wsl()
{
HOST_IP=
$(
echo
"
"
|
powershell.exe -noprofile -Command
"
& {(Get-NetIPAddress | Where-Object {
\$
_.InterfaceAlias -like '*WSL*' -and
\$
_.AddressFamily -eq 'IPv4'}).IPAddress | Write-Host -NoNewline}
"
)
export
DISPLAY=
"
$HOST_IP
:0
"
#
in a wsl shell
ELECTRON=
"
$ROOT
/.build/electron/Code - OSS.exe
"
if
[
-f
"
$ELECTRON
"
]
;
then
local
CWD=
$(
pwd
)
cd
$ROOT
export
WSLENV=ELECTRON_RUN_AS_NODE/w:VSCODE_DEV/w:
$WSLENV
local
WSL_EXT_ID=
"
ms-vscode-remote.remote-wsl
"
local
WSL_EXT_WLOC=
$(
echo
"
"
|
VSCODE_DEV=1 ELECTRON_RUN_AS_NODE=1
"
$ROOT
/.build/electron/Code - OSS.exe
"
"
out/cli.js
"
--locate-extension
$WSL_EXT_ID
)
cd
$CWD
if
[
-n
"
$WSL_EXT_WLOC
"
]
;
then
#
replace \r\n with \n in WSL_EXT_WLOC
local
WSL_CODE=
$(
wslpath -u
"
${WSL_EXT_WLOC
%%
[[:cntrl:]]}
"
)
/scripts/wslCode-dev.sh
$WSL_CODE
"
$ROOT
"
"
$@
"
exit
$?
else
echo
"
Remote WSL not installed, trying to run VSCode in WSL.
"
fi
fi
}
if
[
"
$IN_WSL
"
==
"
true
"
]
&&
[
-z
"
$DISPLAY
"
]
;
then
code-wsl
"
$@
"
elif
[
-f
/mnt/wslg/versions.txt ]
;
then
code --disable-gpu
"
$@
"
elif
[
-f
/.dockerenv ]
;
then
#
Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1263267
#
Chromium does not release shared memory when streaming scripts
#
which might exhaust the available resources in the container environment
#
leading to failed script loading.
code --disable-dev-shm-usage
"
$@
"
else
code
"
$@
"
fi
exit
$?
Back
|
FazBrowse Home
|
New Git URL