Skip to content

Allow spaces in extensions list #968

Closed
rvenutolo wants to merge 2 commits intolinuxserver:code-server-extension-argumentsfrom
rvenutolo:allow-spaces-in-extensions-list
Closed

Allow spaces in extensions list #968
rvenutolo wants to merge 2 commits intolinuxserver:code-server-extension-argumentsfrom
rvenutolo:allow-spaces-in-extensions-list

Conversation

@rvenutolo
Copy link

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Currently, handling the VSCODE_EXTENSION_IDS environment variable does not allow for spaces in the string. This change strips all spaces from that variable before it is used to install extensions.

The VSCODE_EXTENSION_IDS handling will be more flexible to allow spaces and thus allow VSCODE_EXTENSION_IDS declarations like the following in Docker compose file:

VSCODE_EXTENSION_IDS: vscode-icons-team.vscode-icons | ms-azuretools.vscode-docker | ...

or nicer mult-line strings when one has numerous extensions.

VSCODE_EXTENSION_IDS: >
  | vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker
  | ...

Benefits of this PR and context:

This allows the user to include spaces in the VSCODE_EXTENSION_IDS value, which can improve readability in Docker compose files.

How Has This Been Tested?

I replaced the existing /etc/s6-overlay/s6-rc.d/init-mod-code-server-extension-arguments/run file with my updated version.

I ran docker compose up with each of the following VSCODE_EXTENSION_IDS definitions in the compose file. I then looked at the logging to check that the extension IDs were processed as desired.

VSCODE_EXTENSION_IDS: 'vscode-icons-team.vscode-icons|ms-azuretools.vscode-docker|redhat.vscode-yaml|redhat.java'
VSCODE_EXTENSION_IDS: ' |vscode-icons-team.vscode-icons| ms-azuretools.vscode-docker |  redhat.vscode-yaml  |  redhat.java    '
VSCODE_EXTENSION_IDS: >
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: >-
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: >+
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |-
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: |+
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
VSCODE_EXTENSION_IDS: '
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
  '
VSCODE_EXTENSION_IDS: "
  |vscode-icons-team.vscode-icons
  | ms-azuretools.vscode-docker 
  |  redhat.vscode-yaml
  |   redhat.java
  "

Source / References:

N/A

This a convenience to allows for spaces. Ex: `vscode-icons-team.vscode-icons | ms-azuretools.vscode-docker`.

Signed-off-by: Rick Venutolo <rvenutolo@users.noreply.github.com>
Signed-off-by: Rick Venutolo <rvenutolo@users.noreply.github.com>
@LinuxServer-CI
Copy link

PR build pushed to ghcr.io/linuxserver/mods:pull_request_968

@thespad thespad requested a review from aptalca October 24, 2024 18:57
@LinuxServer-CI
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@LinuxServer-CI
Copy link

This pull request is locked due to inactivity

@linuxserver linuxserver locked as resolved and limited conversation to collaborators Feb 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants