Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 8311a1a

Browse files
committed
Ensure .vscode is never owned by root
1 parent a3ecd35 commit 8311a1a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runner.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ func (r *runner) constructCommand(projectDir string) string {
152152
// We start code-server such that extensions installed through the UI are placed in the host's extension dir.
153153
cmd := fmt.Sprintf(`set -euxo pipefail || exit 1
154154
cd %v
155+
# This is necessary in case the .vscode directory wasn't created inside the container, as mounting to the host
156+
# extension dir will create it as root.
157+
sudo chown user:user ~/.vscode
155158
code-server --host %v --port %v \
156159
--data-dir ~/.config/Code --extensions-dir %v --extra-extensions-dir ~/.vscode/extensions --allow-http --no-auth 2>&1 | tee %v
157160
`, projectDir, containerAddr, containerPort, hostExtensionsDir, containerLogPath)

0 commit comments

Comments
 (0)