@@ -6,12 +6,25 @@ set -euo pipefail
66# MINIFY controls whether a minified version of vscode is built.
77MINIFY=${MINIFY-true}
88
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+
922main () {
1023 cd " $( dirname " ${0} " ) /../.."
1124
1225 source ./ci/lib.sh
1326
14- cd lib/vscode
27+ pushd lib/vscode
1528
1629 # Set the commit Code will embed into the product.json. We need to do this
1730 # since Code tries to get the commit from the `.git` directory which will fail
@@ -58,13 +71,32 @@ main() {
5871EOF
5972 ) > product.json
6073
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).
6279 yarn gulp " vscode-reh-web-linux-x64${MINIFY: +-min} "
6380
6481 # Reset so if you develop after building you will not be stuck with the wrong
6582 # commit (the dev client will use `oss-dev` but the dev server will still use
6683 # product.json which will have `stable-$commit`).
6784 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
68100}
69101
70102main " $@ "
0 commit comments