@@ -6,12 +6,25 @@ set -euo pipefail
6
6
# MINIFY controls whether a minified version of vscode is built.
7
7
MINIFY=${MINIFY-true}
8
8
9
+ delete-bin-script () {
10
+ rm " lib/vscode-reh-web-linux-x64/bin/$1 "
11
+ }
12
+
13
+ copy-bin-script () {
14
+ local script=" $1 "
15
+ local dest=" lib/vscode-reh-web-linux-x64/bin/$script "
16
+ cp " lib/vscode/resources/server/bin/$script " " $dest "
17
+ sed -i " s/@@VERSION@@/$( vscode_version) /g" " $dest "
18
+ sed -i " s/@@COMMIT@@/$VSCODE_DISTRO_COMMIT /g" " $dest "
19
+ sed -i " s/@@APPNAME@@/code-server/g" " $dest "
20
+ }
21
+
9
22
main () {
10
23
cd " $( dirname " ${0} " ) /../.."
11
24
12
25
source ./ci/lib.sh
13
26
14
- cd lib/vscode
27
+ pushd lib/vscode
15
28
16
29
# Set the commit Code will embed into the product.json. We need to do this
17
30
# since Code tries to get the commit from the `.git` directory which will fail
@@ -58,13 +71,32 @@ main() {
58
71
EOF
59
72
) > product.json
60
73
61
- # Any platform works since we have our own packaging step (for now).
74
+ # Any platform here works since we will do our own packaging. We have to do
75
+ # this because we have an NPM package that could be installed on any platform.
76
+ # The correct platform dependencies and scripts will be installed as part of
77
+ # the post-install (either during `npm install` or when building a standalone
78
+ # release).
62
79
yarn gulp " vscode-reh-web-linux-x64${MINIFY: +-min} "
63
80
64
81
# Reset so if you develop after building you will not be stuck with the wrong
65
82
# commit (the dev client will use `oss-dev` but the dev server will still use
66
83
# product.json which will have `stable-$commit`).
67
84
git checkout product.json
85
+
86
+ popd
87
+
88
+ # These provide a `code-server` command in the integrated terminal to open
89
+ # files in the current instance.
90
+ delete-bin-script remote-cli/code-server
91
+ copy-bin-script remote-cli/code-darwin.sh
92
+ copy-bin-script remote-cli/code-linux.sh
93
+ copy-bin-script remote-cli/code.cmd
94
+
95
+ # These provide a way for terminal applications to open browser windows.
96
+ delete-bin-script helpers/browser.sh
97
+ copy-bin-script helpers/browser-darwin.sh
98
+ copy-bin-script helpers/browser-linux.sh
99
+ copy-bin-script helpers/browser.cmd
68
100
}
69
101
70
102
main " $@ "
0 commit comments