Skip to content

Commit 0bf5519

Browse files
committed
Fix rg extraction in Docker build
1 parent 1dbda16 commit 0bf5519

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.dockerignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Dockerfile
2-
doc/
2+
build
3+
deployment
4+
doc
5+
.git
36
.github
47
.gitignore
8+
.node-version
59
.travis.yml
610
LICENSE
711
README.md

scripts/tasks.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function build-code-server() {
9999
log "Installing remote dependencies"
100100
cd "${vscodeSourcePath}/remote"
101101
yarn --production --force --build-from-source
102-
cp -r "${vscodeSourcePath}/remote/node_modules" "${codeServerBuildPath}"
102+
mv "${vscodeSourcePath}/remote/node_modules" "${codeServerBuildPath}"
103103

104104
# Only keep the production dependencies.
105105
cd "${codeServerBuildPath}/out/vs/server"

src/util.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ export const open = async (url: string): Promise<void> => {
122122
*/
123123
export const unpackExecutables = async (): Promise<void> => {
124124
const rgPath = (rg as any).binaryRgPath;
125-
if (rgPath) {
125+
const destination = path.join(tmpdir, path.basename(rgPath));
126+
if (rgPath && !(await util.promisify(fs.exists)(destination))) {
126127
await mkdirp(tmpdir);
127-
const destination = path.join(tmpdir, path.basename(rgPath));
128-
await util.promisify(fs.copyFile)(rgPath, destination);
128+
// TODO: I'm not sure why but copyFile doesn't work in the Docker build.
129+
// await util.promisify(fs.copyFile)(rgPath, destination);
130+
await util.promisify(fs.writeFile)(destination, await util.promisify(fs.readFile)(rgPath));
129131
await util.promisify(fs.chmod)(destination, "755");
130132
}
131133
};

0 commit comments

Comments
 (0)