coder / modules

A collection of Terraform Modules to extend Coder templates.
https://registry.coder.com
Apache License 2.0
33 stars 34 forks source link

fix(code-server): handle when the extension folder does not exist yet #278

Closed michaelbrewer closed 3 months ago

michaelbrewer commented 4 months ago

Preemptively create specified extension folder in case the parent folder is missing.

So for example is /home/local/.ws was not created yet and the extension path is /home/local/.ws/extensions then code server will have the following error.

Error: ENOENT: no such file or directory, mkdir '/home/local/.ws/extensions'
    at Object.mkdirSync (node:fs:1380:26)
    at /home/local/.code-server/lib/code-server-4.91.1/lib/vscode/out/vs/server/node/server.main.js:221:1910
    at Array.forEach ()
    at h (/home/local/.code-server/lib/code-server-4.91.1/lib/vscode/out/vs/server/node/server.main.js:221:1875)
    at m (/home/local/.code-server/lib/code-server-4.91.1/lib/vscode/out/vs/server/node/server.main.js:221:2001)
    at /home/local/.code-server/lib/code-server-4.91.1/out/node/main.js:42:15
    at Generator.next ()
    at fulfilled (/home/local/.code-server/lib/code-server-4.91.1/out/node/main.js:5:58) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: '/home/local/.ws/extensions'
}